Skip to content

Instantly share code, notes, and snippets.

@dmsul
dmsul / vim_crash_course.md
Last active May 31, 2025 12:37
Vim Crash Course

NOTE: Specific examples given for options, flags, commands variations, etc., are not comprehensive.

NORMAL MODE

Vim has 2 main "modes", that chance the behavior of all your keys. The default mode of Vim is Normal Mode and is mostly used for moving the cursor and navigating the current file.

Some important (or longer) commands begin with ":" and you will see the text you enter next at the bottom left of the screen.

:q[uit] - quit (the current window of) Vim. ("Window" here is internal to Vim, not if you have multiple OS-level windows of Vim open at once.)
:q! - force quit (if the current buffer has been changed since the last save)
:e[dit] {filename} - read file {filename} into a new buffer.

@tonywok
tonywok / stolen-laptop.md
Last active October 21, 2021 06:35
Preparing for your laptop to be stolen

Preparing for your Laptop to be stolen by some Asshole

Note, at the time of writing this, I use a mac. Adjust to your preference.

Assumptions

If you're reading this and haven't done these things, and your laptop is still in your possession. Stop everything and do them now.

  1. You have an encrypted hard drive (e.g FileVault)
@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
#
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@billrobertson42
billrobertson42 / gist:1721478
Created February 2, 2012 04:27
Turn a StringBuilder into Clojure function
user=> (def buffer (StringBuilder.))
#'user/buffer
user=>
(defn appender [^StringBuilder buffer]
(fn [& args]
(when-let [arg (first args)]
(.append buffer arg)
(recur (rest args)))))
user=> #'user/appender
user=>
anonymous
anonymous / overtone-1.clj
Created December 6, 2011 05:04
(ns test.core
(:use [overtone.live]
[overtone.inst.synth]))
(def kick (sample "kick.wav"))
(def snare (sample "snare.wav"))
(def hit (sample "hit.wav"))
(def insts {:kick kick
:snare snare
:hit hit})
anonymous
anonymous / gist:1434176
Created December 5, 2011 16:27
2co checkout url
https://purchase.test.2checkout.com/checkout/purchase?sid=208364&cart_order_id=EXAMPLE&total=1.00&c_prod_1=1,1&c_name_1=Sample Product&c_description_1=Example product for test purchases.&c_price_1=1.00&demo=N&return_url=&merchant_order_id=Order ID: example&x_receipt_link_url=&card_holder_name=Testing Tester&street_address=123 Anywhere St.&street_address2=&city=Anytown&state=OH&zip=12345&country=USA&[email protected]&phone=555-555-5555&phone_extension=&ship_name=Testing Tester&ship_steet_address=123 Anywhere St.&ship_street_address2=&ship_city=Anytown&ship_state=OH&ship_zip=12345&ship_country=USA&id_type=1&c_tangible_1=&xco_quote_history_ fqh2 ON fqh2.id =