Skip to content

Instantly share code, notes, and snippets.

@ggilder
ggilder / TextMate_scriptmate_fix.rb
Created November 3, 2010 22:35
Fix TextMate's scriptmate.rb to work with Ruby 1.9
# located at /Applications/TextMate.app/Contents/SharedSupport/Support/lib/scriptmate.rb
# change lines 12 - 13:
$KCODE = 'u' if (RUBY_VERSION.to_f < 1.9)
require "jcode" unless "".respond_to? :each_char
# rest of the file is unchanged
/*
Adapt.js licensed under GPL and MIT.
Read more here: http://adapt.960.gs
*/
// Closure.
(function(w, d, config, undefined) {
// If no config, exit.
if (!config) {

Install XHProf

Pear

pear upgrade PEAR
pecl install xhprof-0.9.2

From source

@ChristianPeters
ChristianPeters / css_splitter.rake
Created August 8, 2011 10:22
Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095
// DEPRECATED
// see https://github.com/livereload/livereload-js/blob/master/dist/livereload.js for an up-to-date version
(function() {
var __protocol = {}, __connector = {}, __timer = {}, __options = {}, __reloader = {}, __livereload = {}, __startup = {};
// protocol
(function() {
var PROTOCOL_6, PROTOCOL_7, Parser, ProtocolError;
var __indexOf = Array.prototype.indexOf || function(item) {
@dvessel
dvessel / README.mdown
Last active May 15, 2020 13:18
Sass+Compass, Guard, LiveReload

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@rfay
rfay / .gitignore
Created February 25, 2011 05:59
Create a huge reference repo
nbproject
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@nathansmith
nathansmith / html_reset.css
Created January 28, 2010 00:02
Reset for HTML4 / HTML5
/* `XHTML, HTML4, HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
acronym,
address,
applet,
article,
aside,

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: