Skip to content

Instantly share code, notes, and snippets.

View pateketrueke's full-sized avatar

Alvaro Cabrera Durán pateketrueke

View GitHub Profile
@pateketrueke
pateketrueke / Literate CoffeeScript.tmLanguage
Last active December 24, 2015 15:09
Literate CoffeeScript for SublimeText
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>coffee.md</string>
<string>litcoffee</string>
</array>
@pateketrueke
pateketrueke / Monokai.tmTheme
Last active December 24, 2015 21:09
My Monokai-dark settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@pateketrueke
pateketrueke / slash-lang.txt
Last active December 26, 2015 15:19
Slash lang!
# ubuntu
git clone [email protected]:slash-lang/slash.git
sudo apt-get install libmarkdown2-dev libmysqlclient-dev libyajl-dev libgmp-dev
# apache2
sudo apt-get install apache2 apache2-prefork-dev
sudo ln -s /usr/bin/apxs2 /usr/bin/apxs
sudo ln -s /usr/sbin/apache2 /usr/bin/httpd
# make
@pateketrueke
pateketrueke / addsite.sh
Last active December 27, 2015 17:59
Adds and removes custom vhosts on Apache2
#!/bin/sh
MYSELF="$(whoami)"
WWWDIR="$HOME/www"
DOMAIN=$1
VHOSTDIR="/usr/local/apache2/conf/vhosts"
if [ "$MYSELF" != "root" ]; then
echo "You must execute this as root"
else
@pateketrueke
pateketrueke / mysqlfu.sql
Created November 13, 2013 05:41
MySQL snippets (WUT)
CREATE DATABASE <dbname>;
CREATE USER '<dbuser>'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON <dbname> . * TO '<dbuser>'@'localhost';
REVOKE ALL PRIVILEGES ON <dbname> . * FROM '<dbuser>'@'localhost';
@pateketrueke
pateketrueke / rhino-shim.js
Last active March 25, 2016 20:11
Timers and XHR for ol' Rhino support
// http://ejohn.org/blog/bringing-the-browser-to-the-server/
// timers, xhr
// The window Object
var window = this;
(function(){
var curLocation = (new java.io.File("./")).toURL();
function runTasks(subtasks, callback) {
function next() {
var task = subtasks.shift();
if (!task) {
return callback();
}
task(function (err) {
if (err) {
@pateketrueke
pateketrueke / KeyPad.control.js
Created June 11, 2015 03:27
Custom build for ReLoop KeyPad on BitWig
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
/* global loadAPI, sendSysex, host */
loadAPI(1);
var RL;
var KeyPad = require('./keypad');
function my_prompt_git
__fish_git_prompt | sed -e "s| ||g"
end
function my_prompt_pwd
echo $PWD | sed -e "s|^$HOME|~|" -e "s|.*/||g"
end
function fish_prompt --description 'Write out the prompt'
function nvm
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv
set -l node_dir "$HOME/.nvm/versions/node"
switch (echo $argv[1])
case install
case use
set -l node_version (ls $node_dir | grep $argv[2])
set -l node_version (echo $node_version | cut -d " " -f1)