Skip to content

Instantly share code, notes, and snippets.

@stilist
stilist / console-log.sublime-snippet
Created July 16, 2012 22:59
console.log snippet for Sublime Text 2
<!-- save to ~/Library/Application Support/Sublime Text 2/Packages/User -->
<snippet>
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>log</tabTrigger>
<scope>source.html,source.javascript</scope>
</snippet>
@stilist
stilist / Default (OSX).sublime-keymap
Last active October 6, 2015 15:18
Sublime Text 2 preferences
[
// Drawn from http://www.sublimetext.com/forum/viewtopic.php?f=2&t=7477#p31755
// Kills the annoying default of cmd-left jumping to the start of a line's
// code, rather than column 0.
{ "keys": ["super+left"], "command": "move_to", "args": {"to": "hardbol", "extend": false} },
{ "keys": ["super+right"], "command": "move_to", "args": {"to": "hardeol", "extend": false} }
]
<!doctype html>
<html>
<head>
<script>
Array.prototype.each = function (method) {
if (this) {
if (Array === this.constructor) {
for (i = 0; i < this.length; i++) {
method(this[i]);
}
// Sometimes you want to know the exact pixel dimension of a CSS property, but it’s
// in non-pixel units. This hack might help you out.
//
// Note: assumes a jQuery object `$`.
//
// License: http://github.com/stilist/ratafiacurrant/blob/master/License
var cssDimensionInPx = (function () {
return function ($element, property) {
var dimension = $element.css(property);
// How to determine if you need a vendor prefix to access a CSS property.
//
// License: http://github.com/stilist/ratafiacurrant/blob/master/License
var vendorPrefixes = ["", "-webkit-", "-moz-"];
var test = document.createElement("div");
// http://unscriptable.com/index.php/2009/05/01/a-better-javascript-memoizer/
var cssPrefix = (function () {
var cache = {};
return function (property, value) {
// ==UserScript==
// @name Twitter hashtag eliminator
// @description Hides all hashtags on Twitter
// @include http://www.twitter.com/*
// @include http://twitter.com/*
// @include https://www.twitter.com/*
// @include https://twitter.com/*
// @creator Jordan Cole (http://ratafia.info)
// ==/UserScript==
#!/usr/bin/env ruby -wKU
# encoding: UTF-8
# provided under the MIT license; see
# http://github.com/stilist/ratafiacurrant/blob/master/License
require "rubygems"
require "sinatra"
helpers do
<!doctype html>
<html lang='en'>
<head>
<title>JavaScript Solari Board</title>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script>
$(document).ready(function () {
$("body").append($("<div id='rack'>"));
var from_string = "Hello";
<!doctype html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>Overlay toy</title>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script>
$(document).ready(function () {
$("div.open span").click(function () {
$overlay = $("<div>").attr("id", "overlay").
#!/usr/bin/env ruby -w
=begin
I had paths like:
entries/02009/December/01/x.rc
I wanted paths like:
entries/02009/December/01/text/x.rc
Code provided under the MIT license. Get a copy at