Skip to content

Instantly share code, notes, and snippets.

View chaserx's full-sized avatar
:octocat:
Mostly Meetings. Sometimes not.

Chase Southard chaserx

:octocat:
Mostly Meetings. Sometimes not.
View GitHub Profile
@chaserx
chaserx / peach.txt
Created July 17, 2013 20:25
Parallel Each
# $ gem install peach
# $ irb
1.9.3-p448 :001 > require 'peach'
=> true
1.9.3-p448 :002 > ['a', 'b', 'c'].peach do |p|
1.9.3-p448 :003 > puts p
1.9.3-p448 :004?> end
a
cb
@chaserx
chaserx / capitalize.rb
Created July 17, 2013 16:28
Name Capitalization
# I <3 Ruby
"chase southard".split.map {|n| n.capitalize}.join(' ')
#=> "Chase Southard"
@chaserx
chaserx / fixture_set_test.sublime-snippet
Created December 13, 2012 21:57
Some Sublime Snippets
<snippet>
<content><![CDATA[
test '${1:truth}' do
set = fixture_set(${2:default})
assert true
end
]]></content>
<tabTrigger>fstest</tabTrigger>
<scope>source.ruby</scope>
<description>basic test with fixture set</description>
@chaserx
chaserx / s3_attachments_to_zip.rb
Created March 29, 2012 03:35
S3 Attachments in paperclip to zip file
format.zip {
registrations_with_attachments = Registration.find(:all, :conditions => "abstract_file_name IS NOT NULL")
if registrations_with_attachments.size > 0
headers['Cache-Control'] = 'no-cache'
tmp_filename = "#{Rails.root.to_s}/tmp/tmp_zip_" <<
Time.now.to_f.to_s <<
".zip"
@chaserx
chaserx / quotes.sql
Created March 6, 2012 05:38
String Quotes to mysql
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.15)
# Database: quotes
# Generation Time: 2012-03-06 05:39:44 +0000
@chaserx
chaserx / gist:1967908
Created March 3, 2012 20:01 — forked from xtoddx/gist:1966943
Muralmapper TODO
icon for twitter app
Find how to deploy
- heroku { node + cloudant couchdb }
- dotCloud { node + couchdb }
- nodster for nodejs; cloudant for couch
[done]
Clone into openlexington's github: http://github.com/openlexington/murlamapper.git
Sign up for a twitter account => lexpubart
@chaserx
chaserx / gist:1967031
Created March 3, 2012 17:06 — forked from xtoddx/gist:1967021
Install muralmapper
# brew update
# brew install couchdb
# sudo easy_install pip
# pip install couchapp
# brew install node
# curl http://npmjs.org/install.sh | sh
# git clone https://github.com/mheadd/muralmapper.git -b integration
# cd muralmapper
[TWITTER STUFF]
@chaserx
chaserx / something went wrong with push
Created December 22, 2010 02:58
encountered error with push to repo
rcsouthard@KilgoreLabMBP[suhthurd.com]$: git push origin master
Counting objects: 19, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.91 KiB, done.
Total 10 (delta 7), reused 0 (delta 0)
fatal: unresolved deltas left after unpacking
error: unpack failed: unpack-objects abnormal exit
To git@github.com:chaserx/suhthurd.com.git
! [remote rejected] master -> master (n/a (unpacker error))
@chaserx
chaserx / gist:640811
Created October 22, 2010 16:02
PHP redirect
<?php
/* Lexenomics.org/mayoralforum/index.php */
header("Location: http://plansthis.com/mayoralforum"); /* Redirect browser */
exit();
?>
#################
#### .bashrc ####
#################
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
export LSCOLORS='DxGxcxdxCxegedabagacad'
alias ll='ls -lah'