Skip to content

Instantly share code, notes, and snippets.

View jakeyeung's full-sized avatar

Jake Yeung jakeyeung

View GitHub Profile
@kracekumar
kracekumar / Writing better python code.md
Last active February 19, 2024 03:06
Talk I gave at June bangpypers meetup.

Writing better python code


Swapping variables

Bad code

@MB6
MB6 / WC1
Last active August 29, 2015 14:02
world cup
import requests
resp = requests.get('http://worldcup.sfg.io/matches')
for jogo in resp.json():
if jogo['status'] == 'completed':
print jogo['home_team']['country'], jogo['home_team']['goals'], 'x', jogo['away_team']['country'], jogo['away_team']['goals']
@heygarrett
heygarrett / vimrc
Last active September 6, 2019 07:02
Solarized: Night & Day
" Set colorscheme to solarized
colorscheme solarized
" Change the Solarized background to dark or light depending upon the time of
" day (5 refers to 5AM and 17 to 5PM). Change the background only if it is not
" already set to the value we want.
function! SetSolarizedBackground()
if strftime("%H") >= 5 && strftime("%H") < 17
if &background != 'light'
set background=light
@hugs
hugs / selenium-examples.py
Created February 16, 2011 19:40
Example code for using the Selenium 2 Python bindings.
# To install the Python client library:
# pip install -U selenium
# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver
# iPhone
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')
# Android