"~" signifies the application's folder.
- ~/Library/WebKit/LocalStorage/file__0.localstorage
| #import <Foundation/Foundation.h> | |
| @interface A: NSObject | |
| @end | |
| @implementation A | |
| void pileOfPoo(id self, SEL _cmd) { | |
| NSLog(@"💩"); | |
| } |
| var spawn = require('child_process').spawn; | |
| // spawn_detached(file, [args = []], [options = {}], [callback]); | |
| function spawn_detached(file, args, options, callback) { | |
| if (arguments.length == 2 && | |
| typeof args == 'function') { | |
| callback = arguments[1]; | |
| args = undefined; | |
| } |
| #!/usr/bin/env bash | |
| ## | |
| # Install: | |
| # curl -sL https://raw.github.com/gist/2108403/fast.sh | sh | |
| # | |
| # Share your feedbacks on: | |
| # https://gist.github.com/2108403 | |
| # | |
| # Author: @DAddYE (Twitter/Github) |
| function color_meter(cwith, ccolor) { | |
| if (!cwith && !ccolor) return; | |
| var _cwith = (cwith.charAt(0)=="#") ? cwith.substring(1,7) : cwith; | |
| var _ccolor = (ccolor.charAt(0)=="#") ? ccolor.substring(1,7) : ccolor; | |
| var _r = parseInt(_cwith.substring(0,2), 16); | |
| var _g = parseInt(_cwith.substring(2,4), 16); | |
| var _b = parseInt(_cwith.substring(4,6), 16); |
| // Note: have not tested this - but I think it should work! | |
| function cameraWin(picture){ | |
| var theCanvas = document.getElementById('theCanvas'); | |
| var ctx = theCanvas.getContext('2d'); | |
| var theImage = new Image(); | |
| theImage.src = "data:image/jpeg;base64,"+picture; | |
| ctx.drawImage(theImage, 0, 0); |
| #!/usr/bin/env python | |
| """ | |
| Example on using Kqueue/Kevent on BSD/Mac | |
| using Python. | |
| The TCP server essentially echoes back the | |
| message it receives on the client socket. | |
| """ | |
| __author__ = "Ishwor Gurung <ishwor@develworx.com>" |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| # Xcode 4.3.3 | |
| Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) | |
| Target: x86_64-apple-darwin11.4.0 | |
| Thread model: posix | |
| # Xcode 4.3.2 | |
| Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) | |
| Target: x86_64-apple-darwin11.4.0 | |
| Thread model: posix |
| #Log and type | |
| /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all | |
| # To enable screen sharing | |
| cd /Library/Preferences | |
| echo -n enabled > com.apple.ScreenSharing.launchd | |
| # To disable screen sharing | |
| cd /Library/Preferences | |
| rm com.apple.ScreenSharing.launchd |