Skip to content

Instantly share code, notes, and snippets.

View philsinatra's full-sized avatar
🤘

Phil Sinatra philsinatra

🤘
View GitHub Profile
@dryan
dryan / nav2select.js
Created May 24, 2010 16:59
convert nav links to <select>
var nav = document.getElementById('nav'),
links = nav.getElementsByTagName('a'),
select = document.createElement('select'),
option = document.createElement('option');
for (var i = 0; i < links.length; i++){
var link = links[i],
_option = option.cloneNode(false);
_option.value = link.href; // Set the option's value to the original link
_option.innerHTML = link.innerHTML; // Set the option's text to the original text
@pmuellr
pmuellr / gist:1004413
Created June 2, 2011 13:24
BBEdit Language Module for CoffeeScript
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
BBEdit Language Module for CoffeeScript
Put this file in
~/Library/Application Support/BBEdit/Language Modules
or equivalent.
Based off of the examples shipped in the BBEdit SDK.
@grigs
grigs / browserdetect.js
Created March 13, 2012 17:12
Apple's Browser Detection Script - prettified from http://images.apple.com/global/scripts/browserdetect.js
if (typeof (AC) === "undefined") {
AC = {}
}
AC.Detector = {
getAgent: function () {
return navigator.userAgent.toLowerCase()
},
isMac: function (c) {
var d = c || this.getAgent();
return !!d.match(/mac/i)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@drublic
drublic / Default (OSX).sublime-keymap
Last active October 10, 2015 15:07
My Sublime Text 2 Settings
[
{ "keys": ["ctrl+alt+f"], "command": "use_it" },
{ "keys": ["ctrl+tab"], "command": "prev_view_in_stack" },
{ "keys": ["ctrl+shift+tab"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+shift+j"], "command": "js_run" },
// Paste and indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
@drublic
drublic / rem-fallback.less
Last active March 28, 2020 23:57
Fallback rem-mixin in Sass and LESS
@main-font-size: 16px;
.x-rem (@property, @value) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@px-fallback: @value * @main-font-size;
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`;
-: ~`(function () { return ';@{property}: @{value}rem'; }())`;
}