Contributing to Open Source
=======
First Rule: You can find the time
- It doesn’t take much
- Weekends are good
- Find what other time you’re wasting
- Try something that’s not your day job
Second Rule: What to contribute to?
<!-- | |
rbdWrapper can take several data- attributes: | |
1. data-url : to specificy a specific URL to link to (useful for index pages) | |
2. data-text-color : the text color of "Read". 6 digit hex or "transparent" | |
3. data-bg-color : the bg color. 6 digit hex or "transparent" | |
4. data-show-send-to-kindle : 1 or 0, whether to show the "send to kindle" button or not. | |
5. data-show-read : 1 or 0, whether to show the read buttons or not. | |
A sample is like: | |
--> |
if (phantom.state.length === 0) { | |
if (phantom.args.length !== 1) { | |
console.log('Usage: run-jasmine.js URL'); | |
phantom.exit(); | |
} else { | |
phantom.state = 'run-jasmine'; | |
phantom.open(phantom.args[0]); | |
} | |
} else { | |
window.setInterval(function () { |
web: bin/python test-webapp.py |
<script> | |
chrome.browserAction.onClicked.addListener(function(tab) { | |
var script = "function iprl5(){var d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...) '+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/pUgLJLCrwjg0?u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime()));b.appendChild(z);}catch(e){alert('Please wait until the page has loaded.');}}iprl5();void(0)" | |
chrome.tabs.executeScript(tab.id, {code: script}); | |
}); | |
</script> |
#!/usr/bin/env python | |
""" | |
HTTP Link Header Parsing | |
Simple routines to parse and manipulate Link headers. | |
""" | |
__license__ = """ | |
Copyright (c) 2009 Mark Nottingham |
Contributing to Open Source
=======
First Rule: You can find the time
- It doesn’t take much
- Weekends are good
- Find what other time you’re wasting
- Try something that’s not your day job
Second Rule: What to contribute to?
#!/bin/bash | |
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) | |
if [ -z "$GIT_DIR" ]; then | |
echo >&2 "fatal: hooks/functions: GIT_DIR not set" | |
exit 1 | |
fi | |
read oldrev newrev refname |
1 import urllib2 | |
2 import json | |
221 def basic_authorization(user, password): | |
222 s = user + ":" + password | |
223 return "Basic " + s.encode("base64").rstrip() | |
224 | |
225 def submit_pull_request(user, repo): | |
226 auth = (settings.username, settings.password) | |
227 url = 'https://api.github.com/repos/' + user + '/' + repo + '/pulls' |
import os | |
import pymongo | |
MONGO_URL = os.environ.get('MONGOHQ_URL') | |
if MONGO_URL: | |
# Get a connection | |
conn = pymongo.Connection(MONGO_URL) | |
# Get the database |