Skip to content

Instantly share code, notes, and snippets.

View emilisto's full-sized avatar

Emil Stenqvist emilisto

  • Stockholm
View GitHub Profile
$ node scope.js
6Hz: 4048
214Hz: 4048
var esprima = require('esprima')
, readit = require('readit')
, traverse = require('traverse')
, code = readit()
, prettyjson = require('prettyjson')
, _ = require('underscore')
, path = require('path')
, optimist = require('optimist')
;
@emilisto
emilisto / env.sh
Last active December 16, 2015 02:49
#!/bin/bash
#
# env.sh
#
# Convenience script for loading and unloading a custom shell environment. I
# use it with projects to setup paths e.g. the Django manage script, and
# activating the Python virtualenv.
#
# Author: Emil Stenqvist <[email protected]>
#
# I am the walrus
```
$ eat_my_bucket
...
```
class people::emilisto {
#include osx::chsh
include macvim
include firefox
include chrome
include slate
# Skype is Broken!
# include skype
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:shift;ctrl resize +10% +0
bind left:shift;ctrl resize -10% +0
function abbreviate(str, maxlen) {
maxlen = maxlen || 15;
var fullLength = str.length;
str = str.substr(0, maxlen);
if(str.length < fullLength) str += '...';
return str;
}
[user]
name = Emil Stenqvist
email = [email protected]
[branch]
autosetuprebase = always
[color]
diff = auto
status = auto
@emilisto
emilisto / vimguide.md
Last active December 11, 2015 19:28
Short guide I wrote up for some friends

Emil's short guide to vim

There are two modes in vim:

  1. Command mode – you can't write stuff, keys are interpreted as commands.
  2. Insert mode - it acts like a normal editor, you know you're in insert mode because it says "INSERT" at the bottom.

The most important ones

  • a – enter insert mode from command mode
  • ESCAPE – enter command mode from insert mode
var $el = $(el);
var width = $el.width();
while($el.length) {
console.log('el: %o width: %o', $el, $el.width());
$el = $($el.parent());
}