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 | |
require 'optparse' | |
require 'time' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: git-timesheet [options]\nProduce a per-day activity report from the log of the current git repository.\n\n" |
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 | |
# More correct version in ruby: https://gist.github.com/725094 | |
# Instant timesheet - straight from yo git log! | |
# ...now with commit times as well | |
git log --committer=`git config --get user.email` --format="%ad %s" --simplify-merges --date=iso --since="1 week ago" --reverse | uniq -w 11 --all-repeated=prepend | sed "s/^\(.\{11\}\)\(.\{5\}\).\{9\}/\1\2/" | sed "s/^$//;ta;s/^.\{11\}//;bend;:a;n;s/ /\\n===========\\n\\n/;:end" |grep -iv "merge branch" |
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 | |
require 'rubygems' | |
require 'active_support/core_ext' | |
pattern = ARGV[0] | |
if File.directory?(pattern) | |
pattern += "/*" | |
end |
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
require 'ipaddr' | |
# This is a class that tracks visits on a site internally. | |
# One of the major demands was determining where the visitor came from. | |
class Visitor < ActiveRecord::Base | |
validates_presence_of :entry_uri | |
validates_presence_of :exit_uri | |
validates_presence_of :ip | |
def self.recognizes_source(source_name, options = nil) |
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 | |
require 'etc' | |
windows_keyfile_dir = "D:\\users\\leonid\\keys\\" | |
keyfile_dir = File.expand_path('~/putty_keys') | |
puttygen = `which puttygen`.strip | |
default_ssh_port = 22 | |
default_user = Etc.getpwuid.name |
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
[Main] | |
Env = 1.4.9.1 - 2.0.50727.4927.Microsoft Windows NT 6.1.7600.0 | |
Target = Windows XP Home Edition SP3 - 5.1.2600.5512 - English (United States) | |
[Tasks] | |
Remove Components | |
Tweaks | |
Create a Bootable ISO | |
Options |
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
# put this into yer initializers | |
# | |
# class Ad < ActiveRecord::Base | |
# belongs_to :city | |
# belongs_to :color | |
# cache_title :city, :color | |
# end | |
# | |
# then Ad.first.city_title |
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
<% environments_to_check = ['staging', 'production' ] %> | |
<script type="text/javascript"> | |
var Hoptoad = { | |
host : <%= host.to_json %>, | |
api_key : <%= api_key.to_json %>, | |
notice : <%= notice.to_json %>, | |
checkEnvironment : function(environment) { | |
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 | |
# Lighthouse + Git | |
# post-receive hook | |
LIGHTHOUSE_TOKEN = 'owner token here (the default one)' | |
LIGHTHOUSE_ACCOUNT = 'account (the subdomain)' | |
LIGHTHOUSE_PROJECT = 'project id (look in /projects/[id])' | |
# Store individual user tokens here. | |
# They are required so that changesets are mapped to the correct Lighthouse username |