-
install Xcode
-
install Xcode command line tools
http://cmd.hhmr.biz/2013/09/mavericksxcode-command-line-tools.html
- setup the xcode path
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
var demo = function (num, callback) { | |
var counter = 0; | |
var checkTasksComplete = function() { | |
counter++; | |
if (counter === num) { | |
callback(); | |
} | |
}; | |
// Closure: create a new function with console.log(string) |
<!-- | |
Try to change radio's view | |
Using <input> CSS style 'appearance' | |
But How to display the words in input label? | |
Reference: | |
http://css-tricks.com/almanac/properties/a/appearance/ | |
--> | |
<!doctype html> | |
<html> |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#define test_bool(var) _test_bool(var, #var) | |
void _test_bool(bool var, const char * var_name) { | |
printf("%s => %d\n", var_name, var); | |
printf("true ? %s\n", true == var ? "YES" : "NO"); | |
printf("false ? %s\n\n", false == var ? "YES" : "NO"); | |
} |
#!/bin/sh | |
hg_remote=$1 | |
project_path=$2 | |
function usage() { | |
echo " Usage: ./hggit-clone.sh <mercurial repository remote url> <project path>" | |
echo "Example: ./hggit-clone.sh https://bitbucket.org/oojah/mosquitto mosquitto" | |
} | |
# check hg_remote |
# http://source.android.com/source/downloading.html | |
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo | |
chmod a+x ~/repo | |
sudo mv ~/repo /usr/bin/ |
git tag -d <tag_name> | |
git push origin :refs/tags/<tag_name> |
function byteArrayToString(arr) { | |
var s = ""; | |
arr.forEach(function(i) { | |
s += String.fromCharCode(i); | |
}); | |
return s; | |
} |
install Xcode
install Xcode command line tools
http://cmd.hhmr.biz/2013/09/mavericksxcode-command-line-tools.html
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
#include "stdio.h" | |
void setNumberTo10(int n) { | |
printf("\n%s:\n", __func__); | |
printf("n 記憶體位址 = %p, n 記憶體位址 size = %zu\n", &n, sizeof(&n)); | |
printf("n 記憶體空間的值 = %d, n 記憶體空間的 size = %zu\n", n, sizeof(n)); | |
n = 10; | |
printf("n = %d\n\n", n); | |
} |
#!/bin/bash | |
# When Xcode is upgrade, Xcode Plugin will not work at all. | |
# Use this script to update all your Xcode plugin's compatibility. | |
# https://github.com/supermarin/Alcatraz/issues/213#issuecomment-91288935 | |
# show Xcode version and UUID | |
xcodebuild -version | |
uuid=$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID) | |
echo "UUID $uuid" | |
echo "" |