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
Array.prototype.countCattle = function(type) { | |
var count = 0; | |
for(var i = 0; i < this.length; i++) { | |
if (type == this[i].type) { | |
count++; | |
} | |
} | |
return count; |
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 warningMaker( obstacle , zones ){ | |
var count = 0; | |
return function ( number, location ) { | |
count++; | |
zones.push(location); | |
alert("Beware! There have been " + | |
obstacle + | |
" sightings in the Cove today!\n" + | |
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
var puzzlers = [ | |
function ( a ) { return 8*a - 10; }, | |
function ( a ) { return (a-3) * (a-3) * (a-3); }, | |
function ( a ) { return a * a + 4; }, | |
function ( a ) { return a % 5; } | |
]; | |
alert((puzzlers[(puzzlers[1])(3)])((puzzlers[3])(9))); |
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
sudo port install llvm-3.3 | |
sudo port install ld64 +llvm33 | |
sudo port install cctools +llvm33 | |
sudo port upgrade outdated |
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
/usr/local/bin/appledoc \ | |
--project-name "${PROJECT_NAME}" \ | |
--project-company "Software Machine Development" \ | |
--company-id "com.sumardi" \ | |
--output "~/Projects/Help/${PROJECT_NAME}" \ | |
--install-docset \ | |
--logformat xcode \ | |
--keep-undocumented-objects \ | |
--keep-undocumented-members \ | |
--keep-intermediate-files \ |
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
# add this line to /etc/environment; then reboot | |
LC_ALL="en_US.UTF-8" |
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
[unix_http_server] | |
file=/var/run//supervisor.sock ; (the path to the socket file) | |
chmod=0700 ; sockef file mode (default 0700) | |
[supervisord] | |
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) | |
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) | |
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) | |
; the below section must remain in the config file for RPC |
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
-(BOOL)shouldAutorotate | |
{ | |
return [self.topViewController shouldAutorotate]; | |
} | |
-(NSUInteger)supportedInterfaceOrientations | |
{ | |
return [self.topViewController supportedInterfaceOrientations]; | |
} |
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
{ | |
"Version": "2008-10-17", | |
"Id": "my-id", | |
"Statement": [ | |
{ | |
"Sid": "Allow get requests to specific referrers", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, |
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
# New repository | |
mkdir <repo> && cd <repo> | |
git init | |
git remote add –f <name> <url> | |
git config core.sparsecheckout true | |
echo some/dir/ >> .git/info/sparse-checkout | |
echo another/sub/tree >> .git/info/sparse-checkout | |
git pull <remote> <branch> | |
# Existing repository |