Skip to content

Instantly share code, notes, and snippets.

@egrouse
egrouse / boilerplateme
Created May 29, 2011 20:39
Script to setup html5-boilerplate for Ruby on Rails
#!/bin/bash
# Script to automatically setup a html5-boilerplate Rails folder
# Ellis Grouse <egrouse@ninjad.co>
# Instructions for use:
# mkdir appname
# cd appname
# boilerplateme
# Resource used: http://blog.vertile.com/nathan/2011/02/rvm-rails-git-html5-boiler-plate-what-more-could-you-possibly-want/
jQuery( document ).ready( function(){
jQuery( 'div#images img' ).first().addClass( 'selected' );
jQuery( 'div#descriptions div' ).first().addClass( 'selected' );
});
var images = jQuery( 'div#rsb-slider #images img' ),
descs = jQuery( 'div#rsb-slider #descriptions div' );
descs.mouseenter( function(){
next_image = jQuery( this ).index() - 1;
@egrouse
egrouse / app_controller.rb
Created January 24, 2012 15:52
Rails redirection
class AdminController < ApplicationController
# Execute the filter to authenticate users (::authenticate)
before_filter :authenticate
def user
end
def unit
end
@egrouse
egrouse / sickbeard.sh
Created February 8, 2012 20:07
Sick-Beard quick run script
#!/bin/bash
# Set variables
sickdir='/Users/egrouse/Applications/Sick-Beard'
python='python2.7'
# Change to directory and run SickBeard
cd $sickdir && $python SickBeard.py
@egrouse
egrouse / nzbtunnel.sh
Created February 8, 2012 20:11
BASH script to tunnel NNTP connections
#!/bin/bash
# Script that attempts to create a tunnel for Usenet (NNTP) to pass through
# This script: creates a tunnel, assigns the host address to local address in /etc/hosts
# For Mac OS X
### CONFIGURATION ###
SERVER='your.nntp.server'
PORT='your.nntp.port'
LOCAL='127.0.0.1'
USER='root'
HOST='your.ssh.server'
@egrouse
egrouse / error
Created February 12, 2012 02:53
broadcom-sta, Gentoo, and a MacBook Pro
eth1 Failed to read scan data : Invalid argument
@egrouse
egrouse / gist:1805961
Created February 12, 2012 02:59
How to get Ad-hoc WiFi networks on your Dell Streak
1. Push binary to your phones sdcard (`adb push wpa_supplicant /sdcard`)
2. Open a shell via adb (`adb shell`)
3. Get root! (`su`)
4. Remount the /system partition (`/data/busybox/busybox mount -rw -o remount /system`)
5. Copy the wpa_supplicant binary over the old one
(`/data/busybox/busybox cp /sdcard/wpa_supplicant /system/bin/wpa_supplicant`)
6. Make it executable (`chmod 755 /system/bin/wpa_supplicant`)
7. Reboot your phone
@egrouse
egrouse / Search String - Mac (no .exe)
Created February 14, 2012 11:04
A better MysterBin Chrome search
http://www.mysterbin.com/advsearch?q=-.exe+%s&match=normal&minSize=1&maxSize=max&group=&maxAge=1269&nopasswd=on&complete=0
@egrouse
egrouse / gist:2045890
Created March 15, 2012 18:32
jquery is cool
$(document).ready( function(){
// Do the hidy boxes
$('a.toggle-box').click( function(){
var rel = $(this).attr( 'rel' ),
section = $( 'section#' + rel ),
target = section.find( '.box' );
if( section.hasClass( 'hidden' ) )
{
%section#unit-settings
%h1
= "Editing Unit: #{@unit.name}"
%a{ :href => '#', :class => 'toggle-box', :rel => 'unit-settings' } Hide
.box
= form_for @unit, :url => edit_unit_path( @unit ), :html => { :multipart => true } do |f|
.field
= f.label :name
= f.text_field :name
.field