Skip to content

Instantly share code, notes, and snippets.

@defunkt
defunkt / gist:449668
Created Jun 23, 2010 — forked from dustin/gist:397971
Emacs Lisp to automatically add, commit, and push when files change
View gist:449668
;; Automatically add, commit, and push when files change.
(defvar autocommit-dir-set '()
"Set of directories for which there is a pending timer job")
(defun autocommit-schedule-commit (dn)
"Schedule an autocommit (and push) if one is not already scheduled for the given dir."
(if (null (member dn autocommit-dir-set))
(progn
(run-with-idle-timer
View binary.html
<!-- http://emilsblog.lerch.org/2009/07/javascript-hacks-using-xhr-to-load.html -->
<html5>
<head>
<script language="vbscript">
Function BinaryArrayToAscCSV( aBytes )
Dim j, sOutput
sOutput = "BinaryArrayToAscCSV"
For j = 1 to LenB(aBytes)
sOutput= sOutput & AscB( MidB(aBytes,j,1) )
View Cash_Register_1.rb
puts "What is the amount due?"
total = gets.chomp.to_f
puts "What is the amount tendered?"
paid = gets.chomp.to_f
if paid < total
puts "WARNING: Customer still owes $#{format("%.2f", total-paid)}"
puts Time.now
elsif paid > total
View gist:cda3a6a1d039398f09ee
class JobSchedule
# External interface for calling the service
def self.call(object_id, opts={})
if perform_asynchronously?
Delayed::Job.enqueue(EnqueuedJob.new(name, object_id, opts))
else
perform(object_id, opts)
end
end
View HistoryView--Add-a-method-to-put-a-commit-online.diff
From c6966ade4141e695159b3b38bdc60a7a82d30775 Mon Sep 17 00:00:00 2001
From: Pieter de Bie <pdebie@ai.rug.nl>
Date: Thu, 25 Sep 2008 22:25:46 +0200
Subject: [PATCH] HistoryView: Add a method to put a commit online
---
GitX.xcodeproj/project.pbxproj | 4 +++
Images/spinner.gif | Bin 0 -> 1924 bytes
PBGitCommit.h | 2 +
PBGitCommit.m | 9 +++++++
View log2icalendar.rb
#!/usr/bin/env ruby
#
# Git log to iCalendar
#
# Written by Dmitry Chestnykh, 5 Aug 2008
# Public domain
#
# Usage:
#
# cd git-repo
View gist:29879
#!/usr/bin/ruby
##
# Remove any duplicate tracks in iTunes
# PJ Hyett was here 11/2008
framework "Cocoa"
framework "ScriptingBridge"
itunes = SBApplication.applicationWithBundleIdentifier("com.apple.iTunes")
View fstring.hpp
/** Fast String - Voice Technology
* Simple char[] substitute with faster appender.
* Fernando Gregianin Testa <testa@voicetechnology.com.br>
* v0.1 - Usando no provider v2. 2007-02-22
*/
#ifndef FSTRING_
#define FSTRING_
#include <stdlib.h>
View MacRuby way
person = Person.new
person.name
person.name = name
person.setFirstName(first, lastName:last)
View starcraft.md

Hi, my name is ByunTae from South Korea. I have been playing Starcraft since 1998 and I was born and raised in Korea. I'm 100% full blooded Korean, meaning I have been gifted with unparallel talent to master any video game, particularly, Starcraft: Brood War. I'm also experienced in Counter-Strike, I am able to perform bunny hops, my best score on a public 32 player game was 171-2 with 170 kill streak. I'm offering my expertise in Starcraft to be taught to non-Koreans that wishes to have the skill of a Korean player. I have advised and coached many professional gamers such as Im Jae Dong, Park Myung Soo, Ma Jae Yoon, and more. Boxer and I were great friends until he started using my dropships to gain his fame. I started training other players to be on par with Boxer and eventually surpassing Boxer. He is no longer the best player thanks to my contribution to rest of the players. I did not compete in pro gaming because they KTF did not agree with my seven figure contract demand.

Things I will be teaching in