Skip to content

Instantly share code, notes, and snippets.

@nellshamrell
nellshamrell / nell_vimrc
Created June 20, 2012 18:04
Nell's vimrc
" Configuration file for vim
" Some additional configs that Nell prefers
set number
syntax on
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " more powerful backspacing
@cjoudrey
cjoudrey / chef_solo_bootstrap.sh
Created June 16, 2012 16:39 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo (Ubuntu 12.04)
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install
@lmarburger
lmarburger / objects-on-rails-feed.xml
Created June 14, 2012 22:13
Disgusting hack to play a simple MP3 on iOS using a reasonable app (Instacast in my case).
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Objects on Rails</title>
<link>http://objectsonrails.com</link>
<description>Notes on flexible web application design.</description>
<language>en-us</language>
<copyright>2012</copyright>
<lastBuildDate>Thu, 14 Jun 2012 00:00:00 GMT</lastBuildDate>
<ttl>1</ttl>
@JeffreyWay
JeffreyWay / gist:2889230
Created June 7, 2012 14:56
Simple PHP Quiz
// Fun little quiz
Assuming this string: "January 5th, 2012"
In the shortest amount of code possible, place:
- 'January' within a $month variable
- '5th' within a $day variable
- '2012' within a $year variable.
anonymous
anonymous / gist:2844588
Created May 31, 2012 16:30
<?php echo Form::open(array('class' => 'form-horizontal')); ?>
<div class="row">
<div class="span12">
<h1>Apartments</h1>
<hr />
<?php if (Session::get_flash('success')): ?>
<div class="alert-message success">
<p>
<?php echo implode('', (array) Session::get_flash('success')); ?>
</p>
anonymous
anonymous / gist:2844531
Created May 31, 2012 16:20
public function action_create()
{
if (Input::method() == 'POST')
{
$val = Model_Apartment::validate('create');
if($val->run())
{
$apartment = Model_Apartment::insert(static::$_user['id']);
anonymous
anonymous / gist:2843713
Created May 31, 2012 14:23
<?php
class Validation extends Fuel\Core\Validation{
public static function _validation_unique($val, $options)
{
list($table, $field) = explode('.', $options);
$result = DB::select(strtolower($field))
->where($field, '=', Str::lower($val))
@haf
haf / gist:2843680
Created May 31, 2012 14:19
Get SSH working on Vagrant/Windows/Git

If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.

Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb to comment out the faulty Windows check and add a real SSH check:

# if Util::Platform.windows?
  # raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
                                       # :port => ssh_info[:port],
                                       # :username => ssh_info[:username],
 # :key_path =&gt; ssh_info[:private_key_path]
@jtimberman
jtimberman / tmux.conf
Created April 24, 2012 02:26
solarize-ified colors a bit more, looks decent in light and dark (iterm2)
# bindings
unbind C-a
set -g prefix C-z
bind C-z send-prefix
unbind [
unbind %
unbind '"'
bind Escape copy-mode
require 'jekyll'
LINK = "http://www.example.com"
desc 'Notify Twitter of a new post'
task :tweet do
puts '* Pinging Twitter about the latest post'
options = {}
options = Jekyll.configuration(options)
site = Jekyll::Site.new(options)