Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
@anotherjesse
anotherjesse / readme.md
Last active August 29, 2015 14:01
logstash elasticsearch spot instances

install logstash 1.4 / elasticsearch-1.1.0

bin/elasticsearch

logstash web

bin/logstash web

run logstash ingestor

@anotherjesse
anotherjesse / gist:2522
Created July 25, 2008 21:04
add a santize :column_name to sanitize to html
include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper
module ActiveRecord
class Base
def self.sanitize(attr_name, options = {})
define_method "#{attr_name}=" do |val|
write_attribute attr_name, val
html = ''
@anotherjesse
anotherjesse / block.clj
Last active August 29, 2015 14:10
blocks scad
(ns threed.core
(:use [scad-clj.scad])
(:use [scad-clj.model]))
(centering! false)
(defn lego-single
[]
(difference
(union
@anotherjesse
anotherjesse / ergodox.md
Created December 23, 2014 22:56
ergodox
module ActiveRecord
class Base
# FIXME - WE SHOULD NOT PUT THESE INSIDE AR:B
include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper
def self.sanitize(attr_name, options = {})
define_method "#{attr_name}=" do |val|
write_attribute attr_name, val
html = ''
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
# I DO NOT RECOMMEND USING THIS WORKFLOW - IT DESTROYS HISTORY! - jesse andrews
module GitCommands
extend self
def diff_staging
`git fetch`
@anotherjesse
anotherjesse / gist:47337
Created January 15, 2009 09:24 — forked from dce/gist:44754
log git activity
#!/usr/bin/ruby
require 'rubygems'
require 'git'
log = "~/gitlog.txt"
tmp = "/tmp/gitlog"
commit = Git.open('.').log.first
message = [
commit.date.strftime('%D %H:%M'),
@anotherjesse
anotherjesse / gist:75300
Created March 7, 2009 10:32
create a report of most tweeted firefox extensions
require 'rubygems'
require 'hpricot'
require 'open-uri'
links = Hash.new(0)
# get 50 pages of results from backtweet
(1..50).each do |n|
fn = "backtype-#{n}.html"
unless File.exist?(fn)
@anotherjesse
anotherjesse / gist:87865
Created March 30, 2009 16:53
my simplistic xmonad
module Main (main) where
import XMonad
import System.Exit
import qualified Data.Map as M
import Graphics.X11.Xlib
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad
import XMonad.Prompt.RunOrRaise
@anotherjesse
anotherjesse / gist:98798
Created April 20, 2009 22:17
an attempt to make a ranged named_proxy
class ActiveRecord::Base
named_scope :created, lambda { |date_range|
case date_range
when Range
{:conditions => ["date(created_at) in (?)", date_range]}
when Date
{:conditions => ["date(created_at) = ?", date_range]}
else
{:conditions => '1=1'}
end