This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var json = {a: 1, b: 2}; | |
| // Encode. | |
| var str = JSON.stringify(json); | |
| // Decode. | |
| var decoded = JSON.parse(str); | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSString *formatted = [NSString stringWithFormat: @"Hello, %@!", @"World"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Int string -> Number | |
| parseInt('123.456') // => 123 | |
| // Float string -> Number | |
| parseFloat('123.456') // => 123.456 | |
| // Any | |
| Number('123.456') // => 123.456 | |
| // Hex string -> Number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSString *nsstr = [NSString stringWithUTF8String:cstr]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See. http://stackoverflow.com/a/22224493 | |
| // See also. http://caniuse.com/#feat=classlist | |
| elem.classList.add('foobar'); | |
| elem.classList.remove('foobar') | |
| elem.classList.contains('foobar') |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0000 0123 ori.b #$23, D0 | |
| 0001 0123 ori.b #$23, D1 | |
| 0002 0123 ori.b #$23, D2 | |
| 0003 0123 ori.b #$23, D3 | |
| 0004 0123 ori.b #$23, D4 | |
| 0005 0123 ori.b #$23, D5 | |
| 0006 0123 ori.b #$23, D6 | |
| 0007 0123 ori.b #$23, D7 | |
| 0010 0123 ori.b #$23, (A0) | |
| 0011 0123 ori.b #$23, (A1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Parse; | |
| ... | |
| public void RequestFoobars(List<string> foobarIds) { | |
| Dictionary<string, object> data = new Dictionary<string, object>(); | |
| data.Add("foobarIds", foobarIds); | |
| ParseCloud.CallFunctionAsync<List<object>>("getFoobars", data).ContinueWith(t => { | |
| if (t.IsFaulted || t.IsCanceled || !t.IsCompleted || t.Result == null) { | |
| Debug.Log(t.Exception.GetBaseException().Message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl --header 'Authorization: key=<APIキー>' \ | |
| --header Content-Type:"application/json" \ | |
| https://android.googleapis.com/gcm/send \ | |
| -d '{"registration_ids":["<端末の登録ID>"],"data":{"message":"Hello", "url": "http://www.example.com/"}}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ex. Dictionary<string, string> dic; | |
| foreach (KeyValuePair<string, string> pair in dic) { | |
| Debug.Log(pair.Key + ": " + pair.Value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Convert string encoding | |
| # options: | |
| # -e [encoding] Target encoding (default: utf-8) | |
| require 'kconv' | |
| require 'optparse' | |
| def convert_encoding(lines, to) | |
| encoding = Kconv.guess(lines.join) |