Skip to content

Instantly share code, notes, and snippets.

View leonid-shevtsov's full-sized avatar
🇺🇦
Help Ukraine Win

Leonid Shevtsov leonid-shevtsov

🇺🇦
Help Ukraine Win
View GitHub Profile
#!/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"
#!/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"
alias_method :old_data=, :data=
def data=(value)
old_data=(value)
self.file_updated=true
end
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support/core_ext'
pattern = ARGV[0]
if File.directory?(pattern)
pattern += "/*"
end
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)
#!/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
[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
# 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
<% 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) {
#!/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