Skip to content

Instantly share code, notes, and snippets.

View stenehall's full-sized avatar
🧗‍♂️

Johan Stenehall stenehall

🧗‍♂️
View GitHub Profile
var Plugin = exports.Plugin = function plugin (bot) {
this.listeners = {TRIGGER: 'plugin_name'}; // register TRIGGER to call plugin_name
bot.pluginCore.apply(this, [bot]);
this.plugin_name = function plugin_name (message) {
// Do something fun
}.bind(this);
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
{
"close_windows_when_empty": false,
"color_scheme": "Packages/Base16 Color Schemes/base16-eighties.dark.tmTheme",
"fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
# rake new future=0 title="New post title goes here" slug="slug-override-title"
task :new do
require 'rubygems'
require 'chronic'
require 'stringex'
require 'active_support'
title = ENV["title"] || "New Title"
future = ENV["future"] || 0
desc 'deploy to github'
task :deploy do
puts 'deploying'
sh "git add . && git commit -a -m 'Adding new content' && git push"
puts 'done!'
end
sudo chown -R _mysql /usr/local/var/mysql
sudo chmod -R o+rwx /usr/local/var/mysql
$ cd ~/Desktop $ sudo mv /Library/Preferences/com.apple.Bluetooth.plist .
$ sudo mv ~/Library/Preferences/com.apple.Bluetooth.plist .
$ sudo mv ~/Library/Preferences/ByHost/com.apple.Bluetooth.* .
@stenehall
stenehall / profile_helper.sh
Created June 22, 2015 07:14
profile_helper.sh working for zsh
script_dir=${0%/*}
for script in $script_dir/base16*.sh; do
script_name=$(basename $script .sh)
theme=${script_name#*-}
variation=${theme#*.}
theme=${theme%.*}
base16_${theme}_${variation}() {
parts=("${(@s/_/)0}")
@stenehall
stenehall / app.js
Created April 22, 2015 14:09
Express app for Narratives coffeemaker
var stateCount = 0;
var timer;
var resetTimer;
var brewing = false;
app.post('/brew_hook', function(req, res) {
stateCount++;
clearTimeout(resetTimer);
# Description
# Web hook for the Stockholm coffee brewer
#
# Commands
# there's no commands.
# Author:
# Johan Stenehall <johan@narrativeteam.com> (https://github.com/stenehall)
#
# Contributors:
# Joakim Berglund <joakim@getnarrative.com> (https://github.com/Berglund)