Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sbecker on github.
  • I am sbecker (https://keybase.io/sbecker) on keybase.
  • I have a public key whose fingerprint is 5195 6A86 C824 9EF9 A06D ED06 EEAB DFF0 0B55 CFB3

To claim this, I am signing this object:

@sbecker
sbecker / _.md
Created September 11, 2013 19:25
sin waves
@sbecker
sbecker / _.md
Created September 11, 2013 19:24
sin waves
@sbecker
sbecker / gfr.rb
Created August 25, 2012 04:10 — forked from maxjustus/gfr.rb
Global find and replace with optional confirm (with colored diff)
#! /usr/bin/ruby
require 'rubygems'
require "highline/system_extensions"
require 'colorize'
include HighLine::SystemExtensions
orig, new, args = ARGV
args = Array(args)
file_names = Dir["**/*.*"]
@sbecker
sbecker / footer.php
Created July 28, 2012 08:13
Hacked Wordpress Evidence
@sbecker
sbecker / vagrant.txt
Created June 27, 2011 21:17 — forked from easel/vagrant.org
Installing CentOS 5.5 & Puppet on Vagrant
# -*- coding: utf-8 -*-
* Installing CentOS 5.5 & Puppet
** Notes
** Download install iso: http://mirrors.kernel.org/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-bin-DVD-1of2.iso
** Create a new VirtualBox machine
- Name: vagrant-centos
- Operating System: Linux
<h1>OpenSocial Hello World</h1>
<script type="text/javascript">
var viewer = null;
/**
* Initial data request to load viewer
*/
function getViewerData() {
# issue I'm having with Hpricot 0.7.232 (latest build I believe).
# So to be specific, inside a tag named "description" it seems to behave wrong, with .text returning all of the text in the XML from that point forward.
# If I change the name of the parent tag to anything else, it works right, returning just the text inside the tag. Weird eh? Here is some code, hopefully it formats in a readable way:
# Inside of a tag called 'description' - gives incorrect .text value: "test\n one,two\n"
>> xml = Hpricot.XML(%{
<peon>
<id>1</id>
@sbecker
sbecker / image.rb
Created September 21, 2008 23:18
RSpec matcher for have_named_scope, extended to allow testing of procs - original at http://www.evolve.st/articles/11-testing-named-scope-with-rspec
class Image < ActiveRecord::Base
named_scope :allowed_for, lambda { |account| { :conditions => ["aws_is_public = ? OR account_id = ?", true, account.id] }}
end