Skip to content

Instantly share code, notes, and snippets.

View paultreny's full-sized avatar

Paul Reny paultreny

View GitHub Profile
@navasvarela
navasvarela / .htaccess
Created September 6, 2012 09:05
Sinatra setup in bluehost
AddHandler fcgid-script .fcgi
AddHandler cgi-script .cgi
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@rwilcox
rwilcox / each_line_to_file.py
Created August 2, 2012 13:21
Sends each line in the current BBEdit document to its own file
#!/usr/bin/env python
# A simple script that takes each line of the currently open (and saved!) document
# and outputs a file for each line, named with the first matching group of the name_grep
# regex
#
# It saves its output to a folder named "output" on the desktop
#
# Not really meant for general consumption, but as a tool that gets modified with every new
# time you have to do this.
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 19, 2025 05:22
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@ttscoff
ttscoff / searchFocus.bookmarklet.js
Created July 3, 2012 01:05
Bookmarklet to select the search field on the current page and focus it
javascript:var%20inputs=document.getElementsByTagName('input'),firstSearch=false,textinputs=[],i,t;for(i=0;i<inputs.length;i++)if(((inputs[i].type==='text')||(inputs[i].type==='search'))&&inputs.disabled!==true)textinputs.push(inputs[i]);for(t=0;t<textinputs.length;t++)if((/search/i).test(textinputs[t].className)||(/(^[sq]$|search|query)/i).test(textinputs[t].id)||(/^(q(uery)?|s|.*?search.*)$/).test(textinputs[t].name)){firstSearch=textinputs[t];break;}if(!firstSearch)textinputs[0].focus();else%20firstSearch.focus();
@ttscoff
ttscoff / template_increment.rb
Created June 27, 2012 09:38
Turns templated input into repeating blocks based on start and end numbers
#!/usr/bin/ruby
# Turns templated input into repeating blocks based on start and end numbers
# Basic syntax: `##0,5##` where 0 is start and 5 is end
# Modifiers may be included: `##+4##` will be replaced by the current counter plus four
# One start,end placeholder allowed, any number of modifers
# By Brett Terpstra, 2012 <http://brettterpstra.com>
# WTFPL License <http://en.wikipedia.org/wiki/WTFPL>
input = STDIN.read
@harthur
harthur / snippet.md
Created June 18, 2012 22:12
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }
@kennonb
kennonb / gist:2901006
Created June 9, 2012 13:37
Text Editor Font Smoothing (Textmate & Sublime Text 2)
/*
Found this handy little tip here:
http://madeofcode.com/posts/12-snow-leopard-textmate-font-smoothing
*/
/* TextMate */
defaults write com.macromates.textmate AppleFontSmoothing -int 1
/* Sublime Text 2 */
defaults write com.sublimetext.2 AppleFontSmoothing -int 1
@rwilcox
rwilcox / bbedit_select_sentence.applescript
Created May 30, 2012 13:04
Select Sentence in BBEdit
tell application "BBEdit"
tell text of front text document
-- first, find the end of the previous sentence
-- the \ is because we need to escape the . from grep
-- (we are searching for a period, not "any character" which is what a period
-- normally means in grep
-- however, Applescript also uses the \ as an escape character for its purposes
@rwilcox
rwilcox / web2bbedit.sh
Created May 8, 2012 11:59
Download something from the web directly into BBEdit
#!/bin/sh
curl $1 | /usr/local/bin/bbedit
# Call this script like so:
# web2bbedit.sh http://www.barebones.com
# This will open the Bare Bone Software homepage as HTML in BBEdit