Skip to content

Instantly share code, notes, and snippets.

View DavidYKay's full-sized avatar

David Young-Chan Kay DavidYKay

View GitHub Profile
#!/usr/bin/env python
import unittest
import random
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.graph = { 'a': ['c'],
'b': ['a'],
@DavidYKay
DavidYKay / body.json
Created February 3, 2013 04:52
ORDR.in attempts to post
{ "addr": "1 Main St", "card_bill_addr": "1 Main St", "card_bill_city": "Princeton", "card_bill_phone": "2345678901", "card_bill_state": "NJ", "card_bill_zip": "08542", "card_cvc": "123", "card_expiry": "02/2016", "card_expiry_month": "02", "card_expiry_year": "2016", "card_name": "John Smith", "card_number": "4111411141114111", "card_phone": "2345678901", "city": "Princeton", "delivery_date": "ASAP", "delivery_time": "ASAP", "em": "dk@gargoyle.co", "first_name": "John", "last_name": "Smith", "phone": "2345678901", "restaurant_id": 6373, "rid": 6373, "state": "NJ", "tip": 5.05, "tray": "8926239/1+8926254/1+8926305/1", "type": "res", "zip": "08542" }
@DavidYKay
DavidYKay / styles.xml
Last active December 14, 2015 14:38
Holo theme XML
<style name="Widget.Button">
<item name="android:background">@android:drawable/btn_default</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmallInverse</item>
<item name="android:textColor">@android:color/primary_text_light</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
{"fetchResponse":{"responseCode":"NEW","responseCodeInt":4,"success":true,"data":[{"duration":0,"plannedEffort":90000000,"dates":{"plannedEarlyStart":"2013-01-01T23:54:24+0000","plannedEarlyFinish":"2013-12-31T23:54:24+0000","plannedLateStart":"2013-01-01T23:54:24+0000","plannedLateFinish":"2013-12-31T23:54:24+0000"},"resources":[{"personID":"512ce2e3e4b0355eee5044cf","billable":true,"subID":0}],"schedConstraints":[],"billable":false,"scheduled":false,"milestone":false,"externalService":false,"client":160,"text":[{"textType":"BusText","language":"en","text":"First Stage","original":false,"subID":0}],"hierarchies":[],"busUnits":["5123c186e4b06624ba84f79d"],"extID":"PRJ006-1","responsible":"512ce2e3e4b0355eee5044cf","assigned":["512ce2e3e4b0355eee5044cf"],"categories":[],"recentHistory":[],"files":[],"updateLock":false,"tags":[],"comments":[],"messages":[],"template":false,"intStatus":0,"id":"512d4b9ae4b0320061c843d8","createdOn":"2013-02-26T23:56:10+0000","createdBy":"512ce2e3e4b0355eee5044ce","changedOn":"201
@DavidYKay
DavidYKay / git-sub.sh
Created May 7, 2013 19:10
Git search and replace
#!/bin/bash
#~/.scripts/git-sub
#Author: Khaja Minhajuddin <minhajuddin@cosmicvent.com>
#script which does a global search and replace in the git repository
#it takes two arguments
#e.g. git sub OLD NEW
old=$1
new=$2
@DavidYKay
DavidYKay / video.java
Created May 25, 2013 20:00
Simple VideoView code. Works in an Activity but not a Fragment.
VideoView video = (VideoView) findViewById(R.id.video);
//save video that is in assets folder into root of sd card to play
video.setVideoPath("http://www.androidbegin.com/tutorial/AndroidCommercial.3gp");
video.start();
@DavidYKay
DavidYKay / hello-hiccup.cljs
Created January 19, 2016 05:03
Examples for Clojurescript Workshop 1/19/2016
[:div.top-bar-right
[:ul.menu
[:li [:a {:href "#"} "History"]]
[:li [:a {:href "#"} "Log Out"]]]]
@DavidYKay
DavidYKay / square-root.clj
Created March 22, 2016 05:47
Implementation of the square root function, based on SICP Lecture 1A
(ns example.square-root)
(def tolerance 0.00000000001)
(defn square [x]
(* x x))
(defn avg [& args]
(/ (apply + args)
(count args)))

Keybase proof

I hereby claim:

  • I am davidykay on github.
  • I am davidykay (https://keybase.io/davidykay) on keybase.
  • I have a public key ASAt80YHH2ECRtfB7tculSNU4eKXpkzlzxGEmcFkA-f8wwo

To claim this, I am signing this object:

@DavidYKay
DavidYKay / centroid.py
Created July 10, 2016 20:51
Best fit plane: vertices, normal, centroid
[ 0.21040269, 0.2235437, 0.07060108]