Skip to content

Instantly share code, notes, and snippets.

@zwily
zwily / hack.sh
Created April 2, 2012 17:20 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@zwily
zwily / inputPlugin.js
Last active October 12, 2015 15:48
inputPlugin for LimeChat
// Save this file as: ~/Library/Application Support/LimeChat/inputPlugin.js
// And download this version of LimeChat that supports inputPlugin.js:
// http://cl.ly/0h3B3t3a3H3L
//
// That build of LimeChat includes this commit:
// https://github.com/zwily/limechat/commit/db1cdee2a4b90c3bc2e4956794d92f42a7264193
//
// Shortens URLs that look like graphite using goo.gl. This could
// also be more generic, and just shortens any long URL (that will
// probably end up in a line being split by limechat to get around
@zwily
zwily / gist:4459743
Created January 5, 2013 04:25
making iterating in handlebars suck less
# Used like this:
# {{#foreach "zone" in data.availability_zones}}
# <th>{{zone}}</th>
# {{/foreach}}
Handlebars.registerHelper "foreach", (keyword, blah, collection, ctx) ->
buffer = ""
copy = _.clone(this)
_.each collection, (i) ->
copy[keyword] = i
@zwily
zwily / downscroller.coffee
Last active May 25, 2019 05:03
Puts a big annoying arrow in your Limechat window when you're not scrolled down, like a dummy. (requires limescripts)
## Puts a big annoying arrow in your window when you're not scrolled down, like a dummy
#
scrollAlert = $("<div id='scrolldown-arrow'>⬇</div>")
showing = false
body = $ document.body
win = $ window
doc = $ document
#!/usr/bin/env ruby
require 'rubygems'
require 'highline'
def ask(question)
HighLine.new.ask(question)
end
def ask_secure(question)
@zwily
zwily / gollum-config.rb
Created February 20, 2013 19:26
Add this to your gollum config file to get full GitHub-Flavored Markdown. (including newline behavior)
class GitHub::Markdown
class << self
alias_method :old_render, :render
def render(content)
render_gfm(content)
end
end
end
@zwily
zwily / emoji.coffee
Created February 26, 2013 22:01
emoji (github-flavored) for limechat + limescripts
##
# replaces :blah: with an image with the appropriate emoji
all_emojis = [
'+1', '-1', '100', '1234', '8ball', 'a', 'ab', 'abc', 'abcd', 'accept',
'aerial_tramway', 'airplane', 'alarm_clock', 'alien', 'ambulance', 'anchor',
'angel', 'anger', 'angry', 'anguished', 'ant', 'apple', 'aquarius', 'aries',
'arrow_backward', 'arrow_double_down', 'arrow_double_up', 'arrow_down',
'arrow_down_small', 'arrow_forward', 'arrow_heading_down',
'arrow_heading_up', 'arrow_left', 'arrow_lower_left', 'arrow_lower_right',
<?xml version="1.0" encoding="ISO-8859-1"?>
<xml>
<result>
<ui_conf>
<id>1103</id>
<partnerId>0</partnerId>
<objType>5</objType>
<objTypeAsString>Playlist</objTypeAsString>
<name>kupload 1.0.7</name>
<swfUrl>https://www.instructuremedia.com/flash/kupload/v1.1.7/KUpload.swf</swfUrl>
@zwily
zwily / straitjacket.md
Last active December 14, 2015 12:39
Straitjacket quickstart.

Getting Started with the StraitJacket AMI

Create a security group:

ec2-create-group straitjacket -d "straitjacket testing"
GROUP	sg-dc1cf8b7	straitjacket	straitjacket testing
RUBY_GC_MALLOC_LIMIT=1000000000
RUBY_HEAP_FREE_MIN=500000
RUBY_HEAP_MIN_SLOTS=1000000
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_HEAP_SLOTS_INCREMENT=1000000