Skip to content

Instantly share code, notes, and snippets.

View pateketrueke's full-sized avatar

Alvaro Cabrera Durán pateketrueke

View GitHub Profile
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'
[
{ "keys": ["ctrl+shift+<"], "command": "focus_side_bar" },
{ "keys": ["ctrl+<"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["ctrl+pageup"], "command": "next_view" },
{ "keys": ["ctrl+pagedown"], "command": "prev_view" },
{ "keys": ["ctrl+t"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
@pateketrueke
pateketrueke / heroku.log
Created October 20, 2011 20:13
Current output from "heroku logs"
After push:
2011-10-20T20:00:03+00:00 heroku[api]: Deploy cf9e66c
2011-10-20T20:00:03+00:00 heroku[api]: Release v50 created by pateketrueke@gmail.com
2011-10-20T20:00:06+00:00 heroku[slugc]: Slug compilation finished
2011-10-20T20:00:44+00:00 heroku[web.1]: Starting process with command `sh boot.sh`
2011-10-20T20:00:44+00:00 app[web.1]: Launching apache
2011-10-20T20:00:45+00:00 heroku[web.1]: State changed from starting to up
2011-10-20T20:00:45+00:00 app[web.1]: PHP Warning: PHP Startup: Unable to load dynamic library '/app/www/lib/soap.so' - /app/www/lib/soap.so: cannot open shared object file: No such file or directory in Unknown on line 0
2011-10-20T20:00:45+00:00 app[web.1]: [Thu Oct 20 20:00:44 2011] [notice] Apache/2.2.19 (Unix) PHP/5.3.6 configured -- resuming normal operations
@pateketrueke
pateketrueke / klass.php
Created May 9, 2012 16:19
Klass Implementation for PHP 5.4+
<?php
class Klass {
private $props = array();
public function __construct(array $params = array()) {
$this->props = $params;
}
public function __call($method, $arguments) {
if ($item = $this->$method) {
if ($item instanceof Closure) {
@pateketrueke
pateketrueke / xhprof-example.php
Created May 22, 2012 21:30
XHProf hook example
<?php
call_user_func(function () {
register_shutdown_function(function () {
$data = xhprof_disable();
$obj = new XHProfRuns_Default();
$obj->save_run($data, 'MyApp');
});
@pateketrueke
pateketrueke / .bashrc
Last active October 5, 2015 07:37
My functions; with php's built-in web server
rand_port(){
port=$(( 1234+( $(od -An -N2 -i /dev/random) )%(1023+1) ))
while :
do
(echo >/dev/tcp/localhost/$port) &>/dev/null && port=$(( 1234+( $(od -An -N2 -i /dev/random) )%(1023+1) )) || break
done
echo "$port"
}
phpmin(){
@pateketrueke
pateketrueke / auth-example.php
Created May 28, 2012 05:17
Basic auth with tetl::PHP
<?php
require 'tetlphp/framework/initialize.php';
import('db');
import('www');
import('a_record');
run(function () {
@pateketrueke
pateketrueke / composer-example.php
Created May 28, 2012 05:45
Example loading through the Composer to run tetl:::PHP
<?php
require 'vendor/tetlphp/framework/initialize.php';
import('www');
run(function () {
root(function () {
echo 'Hello ', link_to('World', url_for::some_action());