Skip to content

Instantly share code, notes, and snippets.

View louwers's full-sized avatar
🚲

Bart Louwers louwers

🚲
View GitHub Profile

Note: This version is slightly modified from the original. Creating a symlink to subl did not work for me, but copying did. The disadvantage of this approach is that you have to copy subl in Sublime Text.app to /usr/local/bin every time subl is updated. Try the original guide first if you want!

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

@louwers
louwers / gist:a73ff309a9e8947a2cb1
Created February 1, 2015 11:47
Pinterest focus on search
// ==UserScript==
// @name Pinboard focus on search
// @namespace clishem
// @include https://pinboard.in/u:extrintr
// @version 1
// @grant none
// ==/UserScript==
window.onload = function() {
document.getElementById("search_query_field").focus();
@louwers
louwers / .bashrc
Last active February 6, 2016 13:27
Clear terminal screen Erlang or Elixir with Ctrl+L
# Sets terminal window title until it is overwritten by $PROMPT_COMMAND (when erl is done).
function erl {
echo -ne "\033]0;erl\007"
/usr/bin/erl "$@"
}
@louwers
louwers / window-specific-keybingings.vim
Last active May 25, 2016 20:20
Window-specific keybindings in vim
function! SetWindowMap(map)
exe "noremap <silent> " . a:map . " :call ExecuteWindowMap('" . a:map . "')<CR>"
endfunction
function! ExecuteWindowMap(map)
if exists("w:winMaps") && has_key(w:winMaps, a:map)
call feedkeys(w:winMaps[a:map])
else
exe "unmap " . a:map
let escaped = escape(a:map, "<") "may cause unexpected behavior when mapping "<"
@louwers
louwers / hydra.vim
Last active November 15, 2020 00:38
Hydras for vim: proof of concept
" Based on abo-abo/hydra (an Emacs plugin): hydras for vim.
" maparg can be used to read, store and restore pre-existing mappings.
" also important is having just one place to define hydras
" the rest should be automatically generated
function! Hydra_Move_Enable()
call Hydra_OpenCheatsheet("move")
nmap <buffer> s :m .+1<CR>==
nmap <buffer> w :m .-2<CR>==
nmap <buffer> q :call Hydra_Move_Disable()<CR>
@louwers
louwers / pacaur_install.sh
Last active September 30, 2017 00:45 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "This schema represents a person's blood pressure as a combination of systolic and diastolic blood pressure.",
"type": "object",
"references": [
{
"description": "The SNOMED codes represents Blood pressure (observable entity)",
"url": "http://purl.bioontology.org/ontology/SNOMEDCT/75367002"
}
lookupHtmlForModule :: (FilePath -> FilePath -> FilePath) -> DynFlags -> Module -> IO (Maybe FilePath)
lookupHtmlForModule mkDocPath df m = do
let mfs = go <$> (listToMaybe =<< lookupHtmls df ui)
htmls <- filterM doesFileExist (concat . maybeToList $ mfs)
return $ listToMaybe htmls
where
go pkgDocDir = map (mkDocPath pkgDocDir) [mn, mns]
ui = moduleUnitId m
mn = map (\x -> if x == '.' then '-' else x) mns
mns = moduleNameString $ moduleName m
111963 ? Sl 0:00 /home/bart/src/haskell-ide-engine/.stack-work/install/x86_64-linux-tinfo6/bbcf3bf3969579016955a27e588a21bfbe0d0d7e8644b1b65529ffec02981bf9/8.8.2/bin/hie-wrapper --lsp -d --vomit
112079 ? Sl 0:00 /usr/bin/hie-8.6.5 --lsp -d --vomit
[bart@samadhi ~]$ cabal install hakyll
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
- enclosed-exceptions-1.0.3 (lib) (requires download & build)
- hs-bibutils-6.8.0.0 (lib) (requires download & build)
- http2-1.6.5 (lib) (requires download & build)
- lrucache-1.2.0.1 (lib:lrucache) (requires download & build)
- rfc5051-0.1.0.4 (lib) (requires download & build)
- semigroups-0.19.1 (lib) (requires download & build)