Moved here: https://github.com/rmndk/flac2mp3
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/bash | |
alias ..="cd .." | |
alias ls="ls -p" | |
alias la="ls -lA" | |
alias l="ls -l" | |
alias ll="ls -l" | |
alias psf="ps -cU `whoami`" | |
alias grep="grep --color=auto" | |
alias cack="ack --cpp" |
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/ruby | |
require 'osx/foundation' | |
OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework' | |
include OSX | |
$d=File.basename Dir.pwd | |
Dir.chdir '..' | |
fsevents_cb = proc do |stream, ctx, numEvents, paths, marks, eventIDs| | |
system "rsync --delete -rt --rsh=ssh '#{$d}' 'methylblue.com:public_html/'" |
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
# This is more "Ruby", and I agree that I don't necessarily agree with | |
# all the syntax choices. The else condition isn't required as the | |
# function returns nil if no other code paths executed. You could argue | |
# that, that is a regression waiting to happen though. | |
def just_one_kind_of_response? item, controller | |
case controller | |
when 'actions' | |
item.comments.blank? or item.suggestions.blank? or detail.comments.blank? | |
when 'thoughts' |
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
// gcc -o fswatcher -framework Carbon fswatcher.c | |
#include <CoreServices/CoreServices.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <sys/dir.h> | |
static time_t timestamp = 0; | |
static void callback(ConstFSEventStreamRef stream, |
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/ruby | |
# | |
# Example usage: | |
# tell iTunes to pause | |
# tell iTunes to play | |
# tell Linkinus to quit | |
# | |
# http://twitter.com/mxcl | |
# we add it back later |
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
# Use this for your URL shortening needs | |
# Base 62 is as good as you can easily get for URL shortening | |
# And it's effective: 1_000_000 => '4c92' | |
# Challenge: fork and speed up the implementation! | |
class Fixnum | |
TOKENS = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a | |
# NOTE returns nil for 0 | |
def to_62_s |
“A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”
I think it's from “The moon is a harsh mistress”
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
def inreplace path, before=nil, after=nil | |
[*path].each do |path| | |
f = File.open path, 'r' | |
s = f.read.gsub before, after | |
f.reopen(path, 'w').write s | |
f.close | |
end | |
end | |
require 'pathname' |
OlderNewer