This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shamelessly stolen from parts of bash-it (https://github.com/hmans/bash-it) | |
alias reload='source ~/.bash_profile' | |
# Directory stuff | |
alias sl=ls | |
alias ls='ls -G' # Compact view, show colors | |
alias la='ls -AF' # Compact view, show hidden | |
alias ll='ls -al' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Lovingly ripped off from Brett Terpstra. | |
# http://brettterpstra.com/grabbing-a-mac-apps-icon-advanced-bash-usage-2/ | |
function geticon() { | |
APP=`echo $1|sed -e 's/\.app$//'` | |
APPDIR='' | |
for dir in "/Applications/" "/Applications/Utilities/" "/Developer/Applications/" "/Developer/Applications/Utilties/"; do | |
if [[ -d ${dir}$APP.app ]]; then | |
APPDIR=$dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# VertiCal: A slim monthly calendar (that's perfect for GeekTool) | |
# by Rob Dumas | |
# Copyright (c) 2012 GNU Public License version 3. | |
# See http://www.gnu.org/licenses/licenses.html for details on this license. | |
import sys | |
import datetime | |
import calendar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Source: http://djangosnippets.org/snippets/1431/ | |
Convert numbers from base 10 integers to base X strings and back again. | |
Sample usage: | |
>>> base20 = BaseConverter('0123456789abcdefghij') | |
>>> base20.from_decimal(1234) | |
'31e' | |
>>> base20.to_decimal('31e') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
fib.py | |
A simple Fibonacci sequencer. | |
by Rob Dumas. | |
Public Domain (no copyright restrictions). | |
If someone using our program wants to get 13 numbers in the Fibonacci sequence | |
(or 10 or 100 or any other number), they have to edit our program by hand. Most | |
people don't want to do this, so Python has LIBRARIES (collections of tools) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# This script backs up your flash drive to a local folder. If you're also | |
# using a backup system such as Time Machine (and you are, right?), this | |
# ensures you will have a snapshot of your flash drive the last time you | |
# plugged it in. Time Machine will then capture the folder, thus | |
# automatically creating time-based backups for even your portable storage! | |
# | |
# If you use launchd to run this script whenever you plug your flash drive | |
# into your Mac, you don't even need to think about it. Full instructions on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> | |
<html class="no-js" lang="en"> | |
<!--<![endif]--> | |
<head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LinksController < ApplicationController | |
# GET /links | |
# GET /links.json | |
def index | |
@links = Link.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @links } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Nginx - new server block | |
# http://rosehosting.com | |
# Functions | |
ok() { echo -e '\e[32m'$1'\e[m'; } # Green | |
working() { echo -ne '\e[1;33m'$1'\e[m'; } # Yellow | |
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
widgets.outbrain.com images.outbrain.com odb.outbrain.com trc.taboola.com netstorage.taboola.com images.taboola.com cdn.taboola.com cdn.taboolasyndication.com nau.hexagram.com a.discuscdn.com disqus.com go.disqus.com referrer.disqus.com www.smartlinks.dianomi.com |
OlderNewer