Skip to content

Instantly share code, notes, and snippets.

View unimatrixZxero's full-sized avatar
🌱
💎

Sam Figueroa unimatrixZxero

🌱
💎
View GitHub Profile
@unimatrixZxero
unimatrixZxero / .ackrc
Created April 18, 2013 09:10
My .ackrc file
--type-add=ruby=.haml,.rake,.rsel,.phtml,.ru
--type-add=html=.html.erb,.html.haml,.mustache
--type-add=js=.js.erb
--type-add=css=.sass,.less,.scss
--type-set=markdown=.markdown,.md
--type-set=cucumber=.feature
--type-set=txt=.txt
--type-set=erb=.erb
--type-set=feature=.feature
--type-set=textile=.textile
@unimatrixZxero
unimatrixZxero / Preferences.sublime-settings
Last active December 14, 2015 09:19
SublimeText Config
{
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
@unimatrixZxero
unimatrixZxero / rexml_dos_patch.rb
Last active December 14, 2015 06:59
Patch to guard against REXML DOS vulnerability. (Superfluous if using ruby-1.9.3-p392 or greater) Original patch from the blog post on ruby-lang.org: http://www.ruby-lang.org/en/news/2013/02/22/rexml-dos-2013-02-22/ This one is with a fixed namespace bug in row #41
class REXML::Document
@@entity_expansion_text_limit = 10_240
def self.entity_expansion_text_limit=( val )
@@entity_expansion_text_limit = val
end
def self.entity_expansion_text_limit
@@entity_expansion_text_limit
end
@unimatrixZxero
unimatrixZxero / gist:4224125
Created December 6, 2012 12:29 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end
@unimatrixZxero
unimatrixZxero / a.md
Created August 23, 2012 06:28 — forked from rkh/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
@unimatrixZxero
unimatrixZxero / grep_local_rails_routes.sh
Created August 8, 2012 09:17
A small function for your shell to grep from you running rails server to get the routes. Which is way faster than having to load the environment first using rake routes.
# requirements:
# - currently running rails server
# - gem 'sextant' bundled in your Gemfile
#
# Add this to your .zshrc or .bashrc
# or put it in a separate file and include it like this
# source ~/scripts/grep_local_rails_routes.sh
#
# You can use it like this
# %: routes
@unimatrixZxero
unimatrixZxero / food.rb
Created September 7, 2011 13:05
Food script for campfire
require 'rubygems'
require 'tinder'
require 'uri'
class Food
def initialize(place=nil)
@place = place
end
def prefix
@unimatrixZxero
unimatrixZxero / deploy.rb
Created May 31, 2011 13:45
Play a song when you deploy with capistrano
namespace :deploy do
before 'deploy' do
# run deploy song if available and mpg321 is installed
system('[ -e deploy.mp3 ] && type mpg321 &>/dev/null && mpg321 deploy.mp3 &')
end unless ENV['MUSIC_OFF']
end
@unimatrixZxero
unimatrixZxero / lolbash.sh
Created March 22, 2011 10:02
Putting this here to archive it.
# LOL!!1
# Dunno who made this. BUT I LUVZ IT.
alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
alias visible='echo'
alias invisible='cat'
alias moar='more'
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.