Skip to content

Instantly share code, notes, and snippets.

View zeekay's full-sized avatar
💎
👋

z zeekay

💎
👋
View GitHub Profile
function npm-name-check() {
res="`curl https://npmjs.org/package/$1 -sI | grep 404`"
if [ -z "$res" ]; then
echo awws
else
echo get dat shit
fi
}
@zeekay
zeekay / private.xml
Created December 25, 2012 18:10
KeyRemap4MacBook config mapping capslock to escape (control when used as a modifier).
<?xml version="1.0"?>
<root>
<item>
<name>F19 to Control_L</name>
<appendix>(+ When you type F19 only, send Escape)</appendix>
<!-- Note: identifier has "jis_" prefix for compatibility. -->
<identifier>private.controlL2controlL_escape</identifier>
<autogen>--KeyOverlaidModifier-- KeyCode::F19, KeyCode::CONTROL_L, KeyCode::ESCAPE</autogen>
</item>
</root>
diff '--exclude=*.orig' -urN vim73.orig/runtime/doc/eval.txt vim73/runtime/doc/eval.txt
--- vim73.orig/runtime/doc/eval.txt 2012-10-28 16:12:39.459967383 -0500
+++ vim73/runtime/doc/eval.txt 2012-10-28 16:13:18.210484532 -0500
@@ -6272,8 +6272,8 @@
keymap Compiled with 'keymap' support.
langmap Compiled with 'langmap' support.
libcall Compiled with |libcall()| support.
-linebreak Compiled with 'linebreak', 'breakat' and 'showbreak'
- support.
+linebreak Compiled with 'linebreak', 'breakat', 'showbreak' and
@zeekay
zeekay / ab.rb
Last active December 10, 2015 03:38
require 'formula'
class Ab < Formula
homepage 'http://httpd.apache.org/docs/trunk/programs/ab.html'
url 'http://www.apache.org/dist/httpd/httpd-2.4.3.tar.bz2'
sha1 '0ef1281bb758add937efe61c345287be2f27f662'
def install
# Mountain Lion requires this to be set, as otherwise libtool complains
# about being "unable to infer tagged configuration"
require 'formula'
class ClangCustom < Formula
homepage 'http://llvm.org/'
url 'http://llvm.org/releases/3.2/clang-3.2.src.tar.gz'
sha1 'b0515298c4088aa294edc08806bd671f8819f870'
head 'http://llvm.org/git/clang.git'
end
@zeekay
zeekay / .gitconfig
Last active December 17, 2015 07:09
My gitconfig
[user]
email = [email protected]
name = Zach Kelling
[github]
user = zeekay
[alias]
br = branch
ci = commit
@zeekay
zeekay / func-name.coffee
Last active December 17, 2015 17:28
Get containing function's name.
require('source-map-support').install handleUncaughtExceptions: false
constructorRegex = /^new /
nameRegex = /at (.*) \(/
objectRegex = /^Object\./
log = (message) ->
line = (new Error()).stack.split('\n')[2]
name = (nameRegex.exec line)[1].replace objectRegex, ''
@zeekay
zeekay / .pythonrc
Last active December 18, 2015 14:09
My Pythonrc.
from __future__ import print_function
import os
import sys
# version check
version = 'pypy' if 'PyPy' in sys.version else 'py2' if sys.version_info[0] == 2 else 'py3'
django = ipython = False
# ipython check
@zeekay
zeekay / inject-args.coffee
Created June 26, 2013 20:08
Why would anyone ever want to do this? Reasons...
injectArgs = (func, args...) ->
rawFunc = func.toString()
argNames = (a.trim() for a in (/function \((.*)\)/.exec rawFunc)[1].split(','))
func = rawFunc.replace /function \((.*)\)/, 'function anonymous()'
if args.length != argNames.length
throw new Error 'Function arity must match number of passed arguments'
unless args.length > 0
return new Function func
@zeekay
zeekay / vim-centos.sh
Created July 31, 2013 18:12
Install Vim 7.3 on CentOS.
#!/bin/sh
# install deps
yum install -y gcc make ncurses-devel ruby ruby-devel python python-devel wget
# download vim sources
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
bunzip2 vim-7.3.tar.bz2 && tar xvf vim-7.3.tar
cd vim73