Skip to content

Instantly share code, notes, and snippets.

David Jacobs djacobs

Block or report user

Report or block djacobs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@djacobs
djacobs / automatedBuildAndUploadToTestflight.sh
Created Apr 18, 2012 — forked from amattn/automatedBuildAndUploadToTestflight.sh
Automated Xcode build and upload to TestFlight.
View automatedBuildAndUploadToTestflight.sh
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
View propubnerd-gists.md

Open Source code doesn’t always come in big complex packages. At ProPublica we sometimes share small, simple snippets of using GitHub "Gists." These Gists range from single-byte file delimiters to an entire JavaScript framework for making stepper graphics. They rarely have documentation and don’t even always have names, but they can be super-useful. Here are some we’ve shared over the past few years:

@djacobs
djacobs / euler24.js
Created Nov 30, 2011
Euler 24 solution
View euler24.js
#!/usr/local/bin/node
// basic problem setup
// the answer we want for the millionth iteration is 2783915460
var iteration = 999999;
var size = 2;
// figure out the size of the largest factorial smaller than our target iteration
var tempi = iteration;
@djacobs
djacobs / primes.js
Created Nov 12, 2011
Euler 7 (for Jake)
View primes.js
primecount=1;
i=3;
while(primecount < 10001)
{
// console.log("looking at " + i);
isprime = true;
for (j=(Math.floor(Math.sqrt(i))); j > 1; j--) {
// for (j=2; j < (Math.floor(Math.sqrt(i)) + 1); j++ ) {
@djacobs
djacobs / gist:1356267
Created Nov 10, 2011
Solving Euler problems with @jakedobkin
View gist:1356267
use strict;
#use bigint;
use constant TARGET => 20;
use constant VERBOSE => 1;
my $total = 0;
my %fib;
sub fib($)
View gist:1339858
use strict;
use POSIX;
use bignum;
use constant DEBUG => 0;
my $count = 0;
my $x = 2 ** 1043;
my @s = split(//,$x."a");
@djacobs
djacobs / gist:855940
Created Mar 5, 2011
Every app on my air
View gist:855940
Apps installed...
Soulver
Textmate
Tinkertool
Xcode
Chrome
FaceTime
Evernote
Marsedit
Perian
@djacobs
djacobs / gist:848569
Created Mar 1, 2011
Newbie plack mistake
View gist:848569
# shebang
use constant USER => 'xxxx';
use constant PASS => 'xxxx';
# libraries
use CGI::PSGI;
use Data::Dumper;
use File::Glob qw(:globally :nocase);
use JSON;
View simpledomready.js
function domReady(callback) {
var domLoaded;
var called;
var onReadyStateChange = function () {
if (document.readyState == 'complete') {
domLoaded();
}
};
View gist:818793
djacobs-imac:~ djacobs$ traceroute staging-seriouseats.com
traceroute to staging-seriouseats.com (184.73.242.183), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 0.875 ms 0.702 ms 0.975 ms
2 user-12ld0g1.cable.mindspring.com (69.86.130.1) 30.083 ms 9.112 ms 9.509 ms
3 gig-3-0-11-nycmnyg-rtr2.nyc.rr.com (24.29.151.221) 10.787 ms 30.626 ms 48.379 ms
4 pos-5-0-1-nycmnyg-rtr2.nyc.rr.com (24.29.151.114) 10.579 ms 33.264 ms 12.068 ms
5 ae5-nycsnyoo-rtr1.nyc.rr.com (24.29.148.70) 21.423 ms 14.024 ms 17.880 ms
6 ae-3-0.cr0.nyc20.tbone.rr.com (66.109.6.76) 14.327 ms 13.782 ms 16.063 ms
7 ae-0-0.pr0.nyc30.tbone.rr.com (66.109.6.159) 16.937 ms 62.665 ms 22.409 ms
8 xe-4-2-0.edge2.newark1.level3.net (4.59.20.157) 14.572 ms 12.443 ms 12.908 ms
You can’t perform that action at this time.