Skip to content

Instantly share code, notes, and snippets.

View kocsenc's full-sized avatar

Kocsen Chung kocsenc

  • San Diego
View GitHub Profile
@kocsenc
kocsenc / blueprint.md
Last active June 18, 2023 19:21
Installing jSpin for Unix/Linux and Mac

jSpin for Mac and Linux

This is a quick simple guide to getting jSpin setup for Mac and Linux.

Prereq's

You will need:

  • Java (1.5 +)
@kocsenc
kocsenc / Yahoo finance api.md
Last active July 31, 2019 19:56
SWEN 262 - Interfacing with Yahoo's Finance API

Using Yahoo's Finance API

It was surprisingly hard to find a simple straight forward stock API; this community built API hosted by Yahoo does the job.

Let's get to it.

Below is a complete URL example if you want to play on your own and figure it out.

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22AAPL%22)&env=store://datatables.org/alltableswithkeys
@kocsenc
kocsenc / halloween.py
Last active November 7, 2017 04:30
Cycle some creepy colors on your hue lights for halloween!
#!/usr/bin/env python3
import random
import time
from phue import Bridge
BRIGHTNESS = 255 # Max is 255
TRANSITION_TIME = 100 # Deciseconds for transition
bridge_ip = "192.168.1.172"
@kocsenc
kocsenc / Invite Codes
Last active August 29, 2016 08:22
Invite codes to all the services
# Airbnb
www.airbnb.com/c/kchung41
# Uber
https://www.uber.com/invite/uberkocsen
# Lyft
https://www.lyft.com/invite/KOCSEN1
# Munchery - Home cooked goods
@kocsenc
kocsenc / pisland.py
Last active December 12, 2015 23:12
Island Script
#!/usr/bin/env python
from time import sleep
from selenium.common.exceptions import TimeoutException, StaleElementReferenceException
from selenium.webdriver.support.wait import WebDriverWait
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import sys

Keybase proof

I hereby claim:

  • I am kocsenc on github.
  • I am kocsenc (https://keybase.io/kocsenc) on keybase.
  • I have a public key whose fingerprint is CD11 08CF F262 C618 2657 CE68 EE43 FB56 94FB 1BCE

To claim this, I am signing this object:

@kocsenc
kocsenc / osx-django.md
Last active September 10, 2015 04:00
Installing Django OS X and Windows

Install Django on OS X

Django can be tricky to install on OS X if you don't use the appropriate tools. I am using OS X 10.10 but any lower version should work.

NOTE: I assume you have NOT tried to install Python 3 in some other way, if so delete as much as you can.

  1. Get homebrew. Run ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. brew doctor This will show you if everything is gucci. If it's not cool, then attempt to fix the issues.
  3. brew install python3 This should install both Python 3 and pip3.
@kocsenc
kocsenc / org.nginx.plist
Created August 13, 2015 00:51
nginx plist for Mac
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>nginx</string>
<key>Program</key><string>/usr/local/sbin/nginx</string>
<key>KeepAlive</key><true/>
<key>NetworkState</key><true/>
<key>StandardErrorPath</key><string>/var/log/system.log</string>
@kocsenc
kocsenc / sleepsort.py
Created March 20, 2015 03:43
Sleep Sort with ThreadPool
from concurrent.futures import ThreadPoolExecutor
import time
import timeit
import random
def sleepsort(lst):
"""
Use ThreadPool to execute each thread. Have it sleep for val/100 and then
add itself to results array.