Skip to content
View CurrentDevice.swift
public extension UIDevice {
var modelName: String {
#if (arch(i386) || arch(x86_64)) && os(iOS)
let DEVICE_IS_SIMULATOR = true
#else
let DEVICE_IS_SIMULATOR = false
#endif
var machineString : String = ""
View MicrosTimingTest.ino
#include <functional>
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("");
Serial.println("start");
}
uint32_t measure_time(std::function<void(void)> fn)
View bash
PS1="[\h load:`cat /proc/loadavg | awk '{ print $1; }'`]\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ "
View test_threads_omp.cpp
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <omp.h>
#define NTHREADS 4
void *myFun(void *x)
{
int tid;
View HostedServices.tf
resource "azure_hosted_service" "azure_test_nat" {
name = "azure_test_nat"
location = "North Europe"
ephemeral_contents = false
description = "Nat Gateway Hosted service created by Terraform."
label = "azure_test_nat"
}
View pi3.install.md

Raspberry pi 3 installation

# Add the overlay kernel module
echo "overlay" | sudo tee -a /etc/modules

# customize wifi
echo 'network={
  ssid="your-ssid"
  psk="your-psk"
View Md5.java
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
class MD5 {
public String encrypt(String token) {
int RESULT_LENGTH = 16;
View catalina.sh
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
View colortrans.py
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
Something went wrong with that request. Please try again.