Skip to content

Instantly share code, notes, and snippets.

View haraldmartin's full-sized avatar
🌝

Martin Ström haraldmartin

🌝
View GitHub Profile
#!/bin/sh
# domainavailable
# Fast, domain name checker to use from the shell
# Use globs for real fun:
# domainavailable blah{1..3}.{com,net,org,co.uk}
# Inspired by foca / giles:
# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
for d in $@;
import flash.external.*;
var text:String;
button.onRelease = function() {
text = String(ExternalInterface.call("Clipboard.textToCopy", Key.isDown(KEY.ALT))) || ' ';
System.setClipboard(text);
trace('copied [' + text + ']');
}
daily
missingok
rotate 30
compress
delaycompress
sharedscripts
/Users/deploy/Sites/rails.example.com/shared/log/*.log {
postrotate
touch /Users/deploy/Sites/rails.example.com/current/tmp/restart.txt
function background(iterator, produceNextValue, callbacks) {
var value = {}, hasValue = produceNextValue(value);
callbacks = callbacks || Object.extend([], {
after: function(callback) {
this.push(callback);
return this;
}
});
if (hasValue) {
# Create a ~/.twitter/credentials.yml file.
# Example:
# name: twittername
# password: password
require 'rubygems'
require 'rest_client'
path = File.join(File.join(ENV['HOME'], ".twitter"), "credentials.yml")
user = YAML::load_file(path)
class User < ActiveRecord::Base
# AuthLogic config
acts_as_authentic do |config|
config.validates_format_of_login_field_options = { :with => /\A\w[\w\-_]+\z/, :message => "should use only letters, numbers, and -_ please." }
end
RESERVED_LOGINS = %w( join signin sign-in signout sign-out profile handle ) +
%w( admin sysadmin user username nick upload download static movie video ).
map { |l| [l, l.pluralize] }.flatten.freeze
(*
Open a new tab in Safari (and move focus to the URL bar)
I have this configured as a Quicksilver trigger for ctrl+alt+T
*)
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Tab" of menu "File" of menu bar 1
end tell
# A library for downloading issues of Harpers from the archives.
#
# To use, log in to the archives from your web browser. Then set the
# HARPERS_ARCHIVE_COOKIE environment variable to the value of the .harpers.org
# "archive" cookie, which you can find by visiting the following URL while on
# the Harpers website:
#
# javascript:prompt("HARPERS_ARCHIVE_COOKIE",document.cookie.match(/(?:;|^)\s*archive=(.+?)(?:;|$)/)[1])
#
# Example:
# Rails template for Rails 2.3. Work in progress.
# By Henrik Nyh (http://henrik.nyh.se) 2009-03-29. Public domain.
# Usage: rails myapp -m http://gist.github.com/87341.txt
META_AUTHOR = "Henrik Nyh (http://henrik.nyh.se)"
JQUERY_VERSION = "1.3.2"
APP_NAME = File.basename(Dir.pwd)
git :init
# Rails template for Rails 2.3. Work in progress.
# By Henrik Nyh (http://henrik.nyh.se) 2009-03-29. Public domain.
# Usage: rails myapp -m http://gist.github.com/87341.txt
META_AUTHOR = "Henrik Nyh (http://henrik.nyh.se)"
JQUERY_VERSION = "1.3.2"
APP_NAME = File.basename(Dir.pwd)
git :init