Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
sirkkalap / Find script base dir on most posix environments
Created January 25, 2016 18:56
BASEDIR allows running scripts without cd'ing into their folders first. With properly set basedir all local resources can be referenced without CWD being in the script folder.
#!/bin/sh
BASEDIR=$(cd "$(dirname "$0")"; pwd)
echo $BASEDIR
@jokimaki
jokimaki / core.clj
Last active October 28, 2015 06:33
ClojureBridge/global-growth modifications
(ns clojurebridge.core
(:require [clojure.edn :as edn]
[clj-http.client :as client]
[cheshire.core :as json]))
@hkorpi
hkorpi / vagrant-box.sh
Last active June 25, 2018 14:12
create vagrant box
#!/bin/bash
# Required linux packages for vagrant
sudo apt-get install linux-headers-generic build-essential dkms
# Install VBoxGuestAdditions
wget http://download.virtualbox.org/virtualbox/4.3.22/VBoxGuestAdditions_4.3.22.iso
sudo mkdir /media/VBoxGuestAdditions
sudo mount -o loop,ro VBoxGuestAdditions_4.3.22.iso /media/VBoxGuestAdditions
sudo sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
@jonahoffline
jonahoffline / screenshots_iCloud.md
Created September 1, 2014 19:39
Save screenshots to iCloud Folder (OSX)

Change your default screenshots location (desktop)

defaults write com.apple.screencapture location folder_name_here

Example

Save screenshots to the 'Screenshots' folder (inside iCloud Drive)

defaults write com.apple.screencapture location ~/Library/Mobile\ Documents/com~apple~CloudDocs/Screenshots

@justinmayer
justinmayer / Menlo-for-Powerline.zip
Last active November 18, 2021 17:45
Menlo font, patched for Powerline. Includes regular, bold, italic, and bold italic variants.
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@Steven-Rose
Steven-Rose / gist:3943830
Created October 24, 2012 04:27
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.
@sjl
sjl / Menlo-ForPowerline.ttc.zip
Created January 17, 2012 18:09
Patched Menlo for Powerline. This one includes the bold, italic, etc variants.
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/