Skip to content

Instantly share code, notes, and snippets.

View prenagha's full-sized avatar

Padraic Renaghan prenagha

View GitHub Profile
@dsanson
dsanson / custom.css
Created July 12, 2011 18:16
A custom.css for use with Marked.app
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@duhanebel
duhanebel / instapaperToYojimbo.rb
Created September 9, 2011 16:07
Instapaper CSV to Yojimbo importer
require 'rubygems'
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
require 'appscript'
require 'syslog'
require 'csv'
require 'uri'
include Appscript
@jboner
jboner / latency.txt
Last active May 3, 2024 15:17
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@timarnold
timarnold / gist:3151932
Created July 20, 2012 17:08
TextExpander Snippet (using AppleScript) to open the currently visible page in Safari in Chrome
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
if appIsRunning("Google Chrome") then
tell application "Google Chrome"
make new window
set URL of active tab of window 0 to theURL
activate
end tell
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 2, 2024 03:13
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
@kristianfreeman
kristianfreeman / gist:3203651
Created July 30, 2012 02:45
CSS for drang
html {
zoom: 1.5;
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@SeanPONeil
SeanPONeil / .bash_prompt
Created September 13, 2012 20:05
Sexy Solarized Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Sexy Solarized Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Customized for the Solarized color scheme by Sean O'Neil
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
BASE03=$(tput setaf 234)
BASE02=$(tput setaf 235)
BASE01=$(tput setaf 240)
@ttscoff
ttscoff / allpinboard.rb
Created September 24, 2012 00:09
Grab all Pinboard.in bookmarks for your account, create a bookmark file for Launchbar indexing
#!/usr/bin/ruby
=begin
This script is designed to generate a simple html file with _all_ of your Pinboard.in bookmarks
The HTML file can be added to Launchbar's index as a custom bookmark file and you can search
your entire Pinboard.in collection instantly from Launchbar (by title only). It includes
any applied tags as part of the title to aid in searching.
This does no checking for deltas, it just grabs the whole bunch and overwrites the html file
every time. Don't run it too frequently.