Skip to content

Instantly share code, notes, and snippets.

View dannyprose's full-sized avatar

Danny Palmer dannyprose

View GitHub Profile
@davatron5000
davatron5000 / Sublime Text Setup.md
Last active April 15, 2023 15:39
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

@rodneyrehm
rodneyrehm / gist:6464641
Last active September 18, 2020 02:53
Rachel Nabors: touch and click
// https://coderwall.com/p/yzlqpq
(function($){
function touch(event) {
event.preventDefault();
var runFunc = $(this).data('activateRunFunc');
runFunc && runFunc();
}
function click(event) {
event.preventDefault();
@mirisuzanne
mirisuzanne / nav.scss
Created September 11, 2012 05:46
eliminating gutters
nav {
float: left;
width: columns(4) + gutter()*.5; // the outer two just need half a gutter added.
&:nth-child(2) { width: columns(4) + gutter(); } // the middle needs a full gutter (half on each side).
@include nth-omega(3); // you might not need this, but it may help keep things clean.
}
@dannyprose
dannyprose / Help Danny Get Responsive Susy
Created May 10, 2012 20:38
Helping Danny understand Susy's responsive grids and breakpoints
// Hey Eric, I'm hoping you can help me "get" the responsive part
// of Susy 1.0. I think I'm still a little unsure about it, and
// I'd like to make sure I'm implementing it correctly.
// Please feel free to adjust below into what should be a proper use case.
#main {
@include container;
section.nav {
@include span-columns(12);
/////
/ YAML: data/some_stuff.yml
/
/ awesome_stuff:
/ - title: Awesome Stuff #1
/ author: Danny Palmer
/ content_tag: a-s-1
/
/ - title: Awesome Stuff #2
/ author: Danny Palmer2
@0xSventek
0xSventek / project.rb
Created October 4, 2011 00:45
project
class Project < ActiveRecord::Base
def next
self.class.where("created_at > ?", self.created_at).order("created_at asc").first
end
def previous
self.class.where("created_at < ?", self.created_at).order("created_at desc").first
end
end
@0xSventek
0xSventek / projects_controller
Created October 4, 2011 00:38
projects_controller
class ProjectsController < ApplicationController
before_filter :get_base_project, :only => [:next,:previous]
before_filter :force_js_content_type, :only => [:next,:previous]
caches_action :next, :cache_path => proc{ |c| "/projects/" + (c.get_base_project.next.cache_key rescue "nil")}, :expires_in => 15.minutes
caches_action :previous, :cache_path => proc{ |c| "/projects/" + (c.get_base_project.previous.cache_key rescue "nil")}, :expires_in => 15.minutes
def next
@project = @base_project.next
@0xSventek
0xSventek / routes.rb
Created October 4, 2011 00:31
routes
get '/projects/:base_project_id/next', :to => 'projects#next', :as => :next_project
get '/projects/:base_project_id/previous', :to => 'projects#previous', :as => :previous_project
@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],