Skip to content

Instantly share code, notes, and snippets.

View alderete's full-sized avatar

Michael A. Alderete alderete

View GitHub Profile
@dpk
dpk / gist:646570
Created October 26, 2010 09:05
View Generated Source in BBEdit
-- based on John Gruber's original Safari Source in BBEdit script
-- http://daringfireball.net/2003/01/safari_source_in_bbedit
-- and duct tape
tell application "Safari" to set theSource to do JavaScript "window.document.documentElement.outerHTML" in document 1
tell application "BBEdit"
activate
make new text window with properties ¬
{contents:theSource, source language:"HTML"}
@gruber
gruber / gist:647224
Created October 26, 2010 16:26 — forked from dpk/gist:646570
Slight tweaks to dpkendal's script. Gives the BBEdit document a name (rather than "untitled <integer>", and skips the \n to \r stuff, which I don't think is necessary in recent versions of BBEdit.
tell application "Safari"
set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1
set _name to name of document 1
end tell
tell application "BBEdit"
make new text window with properties ¬
{contents:_source, source language:"HTML", name:"Generated source: " & _name}
select insertion point before character 1 of text window 1
@iansoper
iansoper / CodaLight.scpt
Created December 15, 2010 15:35
Open your web development project in TextMate + Transmit + Terminal (kinda like Coda)
-- Coda Light
--
-- By Henrik Nyh <http://henrik.nyh.se>, 2007-04-26
-- His original script: http://henrik.nyh.se/2007/04/coda-light-applescript
--
-- Changes for Transmit 4 and AppleScript 2 by Ian Soper <http://iansoper.com>, 2010-12-15
--
-- An AppleScript to start working on a web development project by
-- * opening the project in TextMate,
-- * opening related URLs in the default browser,
@ryanb
ryanb / application.html.erb
Created January 19, 2011 19:31
Example of very simple password authentication.
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
@alderete
alderete / my_looper-no_comments.php
Created February 4, 2011 08:06
A starter template for the Custom Loop API in the Thesis theme for WordPress.
<?php
// Source and explanation of this file:
// http://aldosoft.com/blog/2011/01/thesis-custom-loop-template/
class my_looper extends thesis_custom_loop {
function home() {
thesis_loop::home();
}
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
@gruber
gruber / Google Search
Created April 14, 2011 23:09
Perl script that can be used to create a system-wide service to do a Google web search. Input is the selected text in whatever the current app is. The result is a new Google query using your default web browser. (Mac OS X's built-in Search Google service
@kevinold
kevinold / pragprog_magazines.sh
Created August 19, 2011 17:01
Quickly download all Pragprog magazines for this year
for i in 19 20 21 22 23 24 25 26; do wget "http://pragprog.com/magazines/download/$i.mobi"; done
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 8, 2024 22:26
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