Skip to content

Instantly share code, notes, and snippets.

View icco's full-sized avatar
🏠
Working from home

Nat Welch icco

🏠
Working from home
View GitHub Profile
@veer66
veer66 / gcide_extract.rb
Last active August 29, 2015 14:00
Parsing and extracting headwords and part-of-speech from GCIDE and save them to GDBM
require "nokogiri"
require "json"
require 'gdbm'
class LiPosFromGcideExtractor
def parse_each_file(filename)
File.open(filename, "r:ISO-8859-1") do |file|
chunks = file.read
.split(/\n\n/)
.select{|chunk| chunk =~ /^[<\[]\w/}
# Hoptoad integration example.
task "deploy:before" => "isolate:dotgems" do
if /\.gems/ =~ `git status`
abort "Changed gems. Commit '.gems' and deploy again."
end
ENV["TO"] = Deploy.env
end
@rcmachado
rcmachado / soy.vim
Created April 15, 2010 16:59
Soy template syntax
" Vim syntax file
" Language: Soy Templates
" Maintainer: Rodrigo Machado rcmachado@gmail.com
" Last Change: Thu Apr 15 16:59:00 GMT 2010
" Filenames: *.soy
" URL: http://gist.github.com/gists/367358/download
"
" Based on Smarty.vim
" For version 5.x: Clear all syntax items
@icco
icco / gist:461991
Created July 2, 2010 22:24
svn-uberblame
#!/bin/bash
# originally from http://stackoverflow.com/questions/3143575/list-the-files-i-own-in-subversion/3144017
set -e
for file in `svn ls -R`; do
if [ -f $file ]; then
owner=`svn blame $file | tr -s " " " " | cut -d" " -f3 | sort | uniq -c | sort -nr | head -1 | tr -s " " " " | cut -d" " -f3`
if [ $owner ]; then
echo $file $owner
@jpf
jpf / gist:582162
Created September 16, 2010 09:11
--- SHDH statistics ---
42 parties transmitted, 41 parties received, 0.2% party loss
party min/avg/max/stddev = 21/47.976/105/17.097 days
<?php
/**
* Compares all running instances to all reserved instances and reports
* utilization. Useful for making sure you're not wasting money. :P
*
* Requires EC2_CERT and EC2_PRIVATE_KEY environment variables to be set.
*
* @author Dave
* @date 2010-10-05
*/
@ox
ox / C.rb
Created March 6, 2011 23:09
A simple time clocker for your next project.
#!/usr/bin/ruby
# Version (0.78)
# Created by Artem Titoulenko (artem.titoulenko@gmail.com)
# clock in application. I'm tired of counting.
# C.rb -- Time keeping script.
# Call with no params to clock in/out
# Params:
# ? : are you clocked in? check
# log : peek at the work log
@olov
olov / references.rb
Last active September 25, 2015 17:58
Jekyll markdown references plugin by Olov Lassus: Keep all your markdown reference-style link definitions in one file (_references.md)
# references.rb has moved to https://github.com/olov/jekyll-references
// This is a demo of how tail recursion could be implemented, logically
// speaking.
//
// Most C compilers will actually optimize the following code into true
// tail-recursive code (try it at http://llvm.org/demo/ ):
//
// long factorial(long n) {
// if (n == 0) return 1;
// return n * factorial(n - 1);
// }
@optikfluffel
optikfluffel / logstash.conf
Created September 4, 2012 17:00 — forked from jippi/rc.d
Logstash Init script
input {
file {
type => nginx_web
path => ["/var/log/nginx/*"]
exclude => ["*.gz"]
}
}
filter {
grok {