Skip to content

Instantly share code, notes, and snippets.

@jasonsnell
jasonsnell / gist:5033421
Created February 25, 2013 21:19
Macworld/IDG Markdown to HTML AppleScript
--Macworld Markdown to HTML script
--by Jason Snell <jsnell@macworld.com>
--Markdown and SmartyPants by John Gruber <http://daringfireball.net/projects>
--Version 10: Added Euro support and forced Unicode for output file
--Version 11: Output now opens as new document in source window.
--Version 12: Makes sure the output document is set to source language of HTML
--Version 13: Support for [[jump]] tag
--Version 14: Rewrite iLife ‘09 style tags to proper ’09 style.
--Version 15: Support pound symbol
--
-- open currently open URL in Safari in Chrome
-- forked from https://gist.github.com/3151932
--
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
if appIsRunning("Google Chrome") then
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@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
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->