Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Always be sprinting.

Philihp Busby philihp

👨‍💻
Always be sprinting.
View GitHub Profile
View fourkind.py
#!/usr/bin/python
import random
total = 0;
good = 0;
for n in xrange(1,10**8):
s = "{0:0>8}".format(n);
a = {}
@philihp
philihp / fourkind.py
Last active Aug 29, 2015
Monte carlo simulator finding the odds that an 8-digit decimal number has exactly 4 of the same digit.
View fourkind.py
#!/usr/bin/python
import random
total = 0;
good = 0;
for n in xrange(1,100000000):
i = random.randint(0,99999999)
s = "{0:0>8}".format(i);
@philihp
philihp / gvoice.py
Last active Aug 29, 2015
Queries Google Voice's web service for all possible phone numbers
View gvoice.py
#!/usr/bin/python
import sys
import urllib2
import json
opener = urllib2.build_opener()
opener.addheaders.append(('Cookie', ...put your browser session cookies here... ))
for n in xrange(2000,9999):
npad = "{0:04d}".format(n)
View keybase.md

Keybase proof

I hereby claim:

  • I am philihp on github.
  • I am philihp (https://keybase.io/philihp) on keybase.
  • I have a public key whose fingerprint is 093B A359 D87C E901 9AAE ACDF BF99 B090 1209 F481

To claim this, I am signing this object:

View blink.py
@philihp
philihp / gist:8023422
Last active Dec 31, 2015
query for aaron
View gist:8023422
select c.name, m.serialnumber,
first_value(l.username) over (order by l.timestamp desc) as username
from machines m
inner join computersmachine cm on (m.id=cm.machineid)
inner join computers c on (cm.computerid=c.id)
left join logins l on (l.machineid=m.id)
View sos.sas
libname frc 'u:\public\frc';
data frc.records(keep=team_id opponent_id result);
set frc.results;
array red(1:3) red1-red3;
array blue(1:3) blue1-blue3;
select;
when(redScore > blueScore) result = 2;
when(redScore < blueScore) result = 0;
when(redScore = blueScore) result = 1;
end;
View FIRST.java
package sos;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.Set;
View 3strikes.sas
/***
Calculating the odds of the 3-strike game on The Price Is Right
***/
data trials(keep=outcome j strikes);
outcome = 0;
do i=1 to 10000000;
bag = 8;
strikes = 3;
@philihp
philihp / Authenticate.java
Created Apr 5, 2012
Facebook OAuth with Scribe in Struts 1
View Authenticate.java
import org.apache.struts.action.*;
import com.google.gson.*;
import org.scribe.builder.*;
import org.scribe.builder.api.*;
import org.scribe.model.*;
import org.scribe.oauth.*;
public class Authenticate extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
You can’t perform that action at this time.