Skip to content

Instantly share code, notes, and snippets.

View nicinabox's full-sized avatar

Nic Haynes nicinabox

View GitHub Profile
@vinbarnes
vinbarnes / gist:1459efc7b6f5b0faccf6
Created May 19, 2015 14:44
AT&T wireless info on dealing with annoying calls
@topfunky
topfunky / Cakefile
Created April 14, 2011 22:18
Watch both Sass and Coffee files and compile on change (for Node.js)
###
Modified from https://github.com/jashkenas/coffee-script/blob/master/Cakefile
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed.
###
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args) ->
# $ deploy dev // Deploys to staging
# $ deploy // Deploys to production
function deploy() {
if [[ $@ != "" ]]; then
git push staging $@:master
else
git push production
fi
}
@jsonperl
jsonperl / gist:1301602
Created October 20, 2011 16:30 — forked from datapimp/gist:1301586
Cakefile for watching src, compiling coffee to lib, handling sass etc
{spawn, exec} = require 'child_process'
option '-p', '--prefix [DIR]', 'set the installation prefix for `cake install`'
async = require "async"
fs = require "fs"
path = require "fs"
_ = require "underscore"
stdout_handler = (data)->
@mariszin
mariszin / foundation_paginate.rb
Last active September 30, 2015 04:17
Make will_paginate generate markup for Zurb Foundation
# NOTE - I do not support this code anymore.
# You should use plambjet version @ https://gist.github.com/pjambet/5229322
#
# Based on https://gist.github.com/1182136 and https://gist.github.com/1586384
# Make the will_paginate generate markup for Zurb Foundation
# Put this in config/initializers/foundation_paginate.rb
module WillPaginate
module ViewHelpers
class LinkRenderer < LinkRendererBase
protected
@kevinold
kevinold / application_helper.rb
Created March 24, 2012 23:12 — forked from sjungling/application_helper.rb
Zurb Foundation Pagination styles with WillPaginate 3.x on Rails 3.2.x
#
# Concept from https://gist.github.com/1205828
#
module ApplicationHelper
class FoundationLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag(:ul, html, container_attributes)
end
@nicinabox
nicinabox / style.scss
Last active October 3, 2015 15:58
Center UL
ul {
position: relative;
float: left;
left: 50%;
li {
position: relative;
float: left;
left: -50%;
}
}
@nicinabox
nicinabox / archive.sh
Last active December 14, 2015 08:48
Archive a site
wget --mirror -p --html-extension --convert-links -e robots=off -P . SITEURL
@mdp
mdp / README.md
Last active December 14, 2015 14:29

Keep and SSH tunnel up and running on OSX

This is my trick to keep a tunnel running on an OSX host. It's setup so that a network state change will trigger the connection. In practice I've found that it's actually very reliable. Certainly beats starting them by hand.

Notes

  • This uses a 'tunnel' user on your remote host. Because we need to start the tunnel with a passwordless ssh key, it's safer to use a key that just used for this purpose.
  • The remote tunnel user should not have priviledges to login. You only need them to be able to forward ports, shell login is not needed to do this.
@nicinabox
nicinabox / st2.sh
Last active December 28, 2015 08:19
#!/bin/bash
echo -n "Sublime Text 2 or 3? "
read version
echo "Removing file system packages"
rm -r ~/Library/Application\ Support/Sublime\ Text\ $version/Installed\ Packages
rm -r ~/Library/Application\ Support/Sublime\ Text\ $version/Packages
rm -r ~/Library/Application\ Support/Sublime\ Text\ $version/Pristine\ Packages