Skip to content

Instantly share code, notes, and snippets.

@jbonney
jbonney / crontab.sh
Created December 4, 2013 18:06
Add crontab to Synology drives (/sbin/crontab).
#!/bin/sh
#
# Provides missing crontab editing
# Note: Synology crond requires arguments separated by a TAB character
# and the crontab user field only supports root. These requirements are
# enforced by this script.
#
# John Kelly, 2013-05-03
#
SCRIPTNAME=`basename $0`
@jbonney
jbonney / links.txt
Created November 10, 2013 20:15
Email framework from Zurb
@jbonney
jbonney / links.txt
Created November 1, 2013 11:10
Form styling links (Floating label form pattern)
@jbonney
jbonney / links.txt
Created October 21, 2013 17:11
Redis cache system. Some references.
@jbonney
jbonney / tunnel_monit.sh
Created October 18, 2013 13:41
Access remote monit server through SSH
ssh -L 8081:localhost:2812 user@server.com -f -N
#1: %x{ } – quick and easy
name = 'ls'
result = `which #{name}` # or result = %x{which #{name}}
#2: system – when you want to know how it went
result = system 'cp', '/full/path/to/my_file', '/target/directory'
if result.nil?
puts "Error was #{$?}"
elsif result
puts "You made it!"
#Reload configuration file
monit -c monit.conf reload
#Check processes monitored by monit
monit -c monit.conf status
#Start a process
monit -c monit.conf start name
#Stop a process
branches

Get a nice pretty list of available branches.

sync [<branch>]

Syncronizes the given branch. Defaults to current branch. Stash, Fetch, Auto-Merge/Rebase, Push, and Unstash. You can only sync published branches.

switch <branch>

Switches to specified branch.

devise_for :users, :skip => [:registrations, :sessions] do
# devise/registrations
get 'signup' => 'devise/registrations#new', :as => :new_user_registration
post 'signup' => 'devise/registrations#create', :as => :user_registration
get 'users/cancel' => 'devise/registrations#cancel', :as => :cancel_user_registration
get 'users/edit' => 'devise/registrations#edit', :as => :edit_user_registration
put 'users' => 'devise/registrations#update'
delete 'users/cancel' => 'devise/registrations#destroy'
# devise/sessions
@jbonney
jbonney / archive_git.sh
Created September 13, 2013 15:17
Create archive from git repository without git history information. From http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
git archive master | bzip2 > source-tree.tar.bz2