Skip to content

Instantly share code, notes, and snippets.

View jaredlwong's full-sized avatar
🙈
I may be slow to respond.

Jared Wong jaredlwong

🙈
I may be slow to respond.
View GitHub Profile
# CLOSURES IN RUBY Paul Cantrell https://innig.net
# Email: username "paul", domain name "innig.net"
# I recommend executing this file, then reading it alongside its output.
#
# Alteratively, you can give yourself an unreasonable Ruby test by deleting all
# the comments, then trying to guess the output of the code!
#
# (Naive HR departments, please do not use that idea as a hiring quiz.)
@jaredlwong
jaredlwong / Useful Oneliners
Last active August 29, 2015 14:05
Useful Oneliners
# delete each file from stdin delimited by space or newline
xargs -n1 rm
# delete each file found using find (ex w/ .ds_store)
find . -name .DS_STORE | xargs -n1 rm
# for each url in urls run curl, grep some other url and then download each
# of these urls
cat urls | xargs -n1 -I{} sh -c "curl -s {} | grep $OTHERURL" | xargs -n1 wget
@jaredlwong
jaredlwong / fullscreener
Last active August 29, 2015 14:02
Make all windows in OS X maximized using applescript
#!/usr/bin/osascript
-- Save as fullscreener.applescript
tell application "Finder"
set {x1, y1, x2, y2} to (bounds of window of desktop)
end tell
tell application "System Events"
repeat with aProcess in processes
@jaredlwong
jaredlwong / neovim.dockerfile
Last active August 29, 2015 13:57
Neovim Dockerfile
FROM ubuntu
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
# set up root:root and me:me
@jaredlwong
jaredlwong / neovim-make-out
Created March 26, 2014 13:28
Output from a failed make of neovim
me@e9a280256320:~$ sudo apt-get install libtool autoconf automake cmake libncurses5-dev g++ pkg-config
[sudo] password for me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
autotools-dev binutils bsdmainutils cmake-data cpp cpp-4.6 emacsen-common file g++-4.6 gcc gcc-4.6 libarchive12 libasn1-8-heimdal libc-dev-bin libc6-dev libclass-isa-perl libcurl3 libcurl3-gnutls libgcrypt11 libgdbm3 libgmp10
libgnutls26 libgomp1 libgpg-error0 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 libltdl-dev libltdl7 libmagic1 libmpc2 libmpfr4 libnettle4
libp11-kit0 libquadmath0 libroken18-heimdal librtmp0 libsasl2-2 libsasl2-modules libstdc++6-4.6-dev libswitch-perl libtasn1-3 libtinfo-dev libwind0-heimdal libxml2 libxmlrpc-core-c3 linux-libc-dev m4 manpages manpages-dev perl
perl-modules sgml-base xml-core