Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains hidden or 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 fcntl | |
| import time | |
| import sys | |
| lock = file('singleapp.lock', "w+") | |
| try: | |
| fcntl.lockf(lock, fcntl.LOCK_EX|fcntl.LOCK_NB) | |
| except Exception, e: | |
| print "kill me before start again" |
This file contains hidden or 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
| require 'date' | |
| author = "fenbi" | |
| email = "codeluo@gmail.com" | |
| date = Date.new(2012, 7, 30) | |
| l = %w{ | |
| . . . . . . . | |
| . . o . . . . | |
| . . o . . . . |
This file contains hidden or 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 | |
| git filter-branch --env-filter ' | |
| an="$GIT_AUTHOR_NAME" | |
| am="$GIT_AUTHOR_EMAIL" | |
| cn="$GIT_COMMITTER_NAME" | |
| cm="$GIT_COMMITTER_EMAIL" | |
| if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ] |
This file contains hidden or 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 | |
| # ^ 1.8.x or 1.9, folks! | |
| require 'rubygems' | |
| require File.expand_path('./md_izer', File.dirname(__FILE__)) | |
| render_options = { | |
| :fenced_code_blocks => true, | |
| :autolink => true, | |
| :space_after_headers => true |
NewerOlder