Skip to content

Instantly share code, notes, and snippets.

View ckwang8128's full-sized avatar

Courtney Wang ckwang8128

View GitHub Profile
@ckwang8128
ckwang8128 / BBall.java
Created August 8, 2012 20:40 — forked from bh3/BBall.java
Google Basketball Doodle Solution (Java)
import java.awt.Robot;
import java.awt.AWTException;
import java.awt.event.KeyEvent;
public class BBall {
public static void main(String[] args) throws AWTException {
Robot rob = new Robot();
int delay[] = { 300, 220, 840, 1000, 1150, 1500};
int repeat[]= { 3, 2, 5, 5, 4, 2};
rob.delay(2000);
@ckwang8128
ckwang8128 / basketball.scpt
Created August 8, 2012 20:35
AppleScript to play Google's Basketball Doodle. Start Chrome, then run this, move to Chrome, press the play button on the doodle. Watch it go!
tell application "Google Chrome"
tell window 1
set newTab to make new tab with properties {URL:"https://www.google.com/doodles/basketball-2012"}
end tell
delay 5
beep
delay 0.2
tell application "System Events"
set x to 1
tell process "Google Chrome"

Recommendation Engine API Documentation

Notes

  • Anything enclosed in parentheses is an OPTIONAL variable field.
  • Everything preceded with a colon, ':', is a necessary variable field.
  • Server hostname is omitted for clarity and brevity.

#User API :

  • POST /api/users -- Creates a user
require 'neo4j'
class User < Neo4j::Rails::Model
include Neo4j::NodeMixin #Should this be here?
property :name
property :id
index :id, :type => :exact
index :name, :type => :exact
require 'neo4j'
class User < Neo4j::Rails::Model
include Neo4j::NodeMixin #Should this be here?
property :name
property :id
index :id, :type => :exact
index :name, :type => :exact
@ckwang8128
ckwang8128 / problem1.py
Created February 11, 2012 01:12
A set of 3 python scripts that I used to solve embed.ly's programming challenge.
def digit_sum(num):
return sum(map(int, str(num)))
n = cur_num = 1
while (digit_sum(cur_num*n) != 8001):
cur_num = cur_num*n
n += 1
print n