Skip to content

Instantly share code, notes, and snippets.

View jasonm23's full-sized avatar

Jason Milkins jasonm23

View GitHub Profile
class NestedAttributesForStrategy
def association(runner)
runner.run
end
def result(evaluation)
evaluation.object.tap do |instance|
evaluation.notify(:after_build, instance)
return attributes(instance)
end
@jasonm23
jasonm23 / git-ignore
Last active August 29, 2015 14:02 — forked from anonymous/git-ignore
Use to quickly add patterns to .gitignore
#!/bin/sh
# Install:
#
# copy to /usr/local/bin
#
# Usage:
#
# git ignore [[pattern] [pattern] [...]]
#

My modified fork of agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

Compatibility

@jasonm23
jasonm23 / .ctags
Last active August 29, 2015 14:18 — forked from rosenfeld/.ctags
--langdef=CoffeeScript
--langmap=CoffeeScript:.coffee
--regex-CoffeeScript=/(^|=[ \t])*class ([A-Za-z.]+)( extends [A-Za-z.]+)?$/\2/c,class/
--regex-CoffeeScript=/^[ \t]*@?([A-Za-z.]+):.*[-=]>.*$/\1/f,function/
--regex-CoffeeScript=/^[ \t]*([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\1/f,function/
--regex-CoffeeScript=/^[ \t]*([A-Za-z.]+)[ \t]+=[^-=>\n]*$/\1/v,variable/
@jasonm23
jasonm23 / .ctags
Last active August 29, 2015 14:18 — forked from rosenfeld/.ctags
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,field/
--regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/f,field/
require 'rubygems'
require 'html2markdown'
first_block = <<END
<div id="wikicontent" style="padding:0 3em 1.2em 0">
<p><img src="http://cjcat2266.googlepages.com/Emitterlogo.png"> </p><h1><a name="Emitter_is_now_version_2.1">Emitter is now version 2.1</a><a href="#Emitter_is_now_version_2.1" class="section_anchor">¶</a></h1><p><a href="http://emitter.googlecode.com/svn/trunk/docs/index.html" rel="nofollow">Documentation</a> </p><p><a href="http://cjcat.blogspot.com/2009/06/using-tortoisesvn-to-check-out-files.html" rel="nofollow">How to check out the latest source files from the SVN repository</a> </p><hr><h2><a name="Emitter_Video_Tutorials_are_now_available_on_!!">Emitter Video Tutorials are now available on YouTube!!</a><a href="#Emitter_Video_Tutorials_are_now_available_on_!!" class="section_anchor">¶</a></h2><p><a href="http://www.youtube.com/view_play_list?p=84AC3DE6772538E4" rel="nofollow"><img src="http://www.sabredefence.com/images/youtube_logo.gif"></a> </p><p>Check out the complete playlist <a hr
@jasonm23
jasonm23 / gist:810412
Created February 3, 2011 23:02 — forked from rdp/gist:810398
// enum.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cstdio>
#include <cstring>
#include <windows.h>
#include <comcat.h>
int _tmain(int argc, _TCHAR* argv[])
##
# Authentication Plugin via omniauth on Padrino
# prereqs:
# http://github.com/intridea/omniauth/
# http://github.com/achiu/omniauth/ working fork
#
module OmniAuthInitializer
def self.registered(app)
require 'omniauth'
@jasonm23
jasonm23 / mountain-lion-brew-setup.markdown
Created May 23, 2012 03:22 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@jasonm23
jasonm23 / script.md
Created June 6, 2012 14:31 — forked from tomoconnor/script.md
Redis 2.2 Install on Ubuntu 10.04

Installation commands:

wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
tar xvfz redis-2.2.2.tar.gz 
cd redis-2.2.2/
mkdir -p /opt/redis
make PREFIX=/opt/redis install
cp redis.conf /opt/redis/redis.conf
sudo useradd redis