#Mac OS X
Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.
- All jquery plugins should be prefixed with jquery, such as
jquery.facebox
- All github-specific jquery plugins should be prefixed with jquery.github. Like
jquery.github.repo_list.js
- All page-specific files (that only run on ONE page) should be prefixed with page.
page.billing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Emulating Ruby-style code blocks in Python. | |
This example was demonstrated in the PyCon'10 talk titled "Python Metaprogramming". | |
""" | |
import sys | |
import types | |
def receive_block(func): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple python program demonstrating how certain blocking syscalls can be offloaded to a thread-pool and | |
then be able to fetch the results from these system calls in a non-blocking way by doing select() on | |
a pipe between the main thread and the threads in the pool. | |
This is the technique being used by node.js to offer a unified non-blocking Javascript API even for | |
things like file I/O which is traditionally done via blocking syscalls. This idea was described by | |
Ryan Dahl at JSConfEU 2009. | |
-- Harish Mallipeddi - Dec 3 2009 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import with_statement # needed for python 2.5 | |
from fabric.api import * | |
from fabric.contrib.console import confirm | |
# ================================================================ | |
# NOTE: | |
# using this fabfile expects that you have the python utility | |
# fabric installed locally, ssh access to reamea.com, and your | |
# ssh public key associated with the account '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# | |
# Save in your path as "isreg" and chmod +x. Then: isreg domain.com | |
# | |
puts `whois #{ARGV[0]}` =~ /No match for \"#{ARGV[0]}\"/mi ? "No" : "Yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
import datetime | |
class MonthYearWidget(forms.MultiWidget): | |
""" | |
A widget that splits a date into Month/Year with selects. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def logrotate(filename): | |
""" | |
Return the next available filename for a particular filename prefix. | |
For example: | |