Skip to content

Instantly share code, notes, and snippets.

@sorribas
sorribas / keybase.md
Created November 1, 2019 11:12
keybase.md

Keybase proof

I hereby claim:

  • I am sorribas on github.
  • I am sorribas (https://keybase.io/sorribas) on keybase.
  • I have a public key ASDw7JonfhN1tL5f1R4MjdvoKkpJjG_O3DpvmWGLfQQJoQo

To claim this, I am signing this object:

set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'fatih/vim-go'
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
var mmm = require('multi-master-merge');
var leveljs = require('level-js');
var levelup = require('levelup');
var lup = levelup('invoicer', { db: leveljs });
var db = mmm(lup, {encoding: 'json'});
db.put('a', {}, function() {
db.get('a', function(err, val) {
console.log(val);
(defmacro timeperiod [& x]
(cond (= (first (rest x)) 'minutes) (list * (first x) 60000)
(= (first (rest x)) 'seconds) (list * (first x) 1000)
(= (first (rest x)) 'hours) (list * (first x) 3600000)
:else 0))
var x = 3;
if (x % 2 == 0)
{
console.log('EL número es par');
console.log('...');
}
else
{
console.log('EL número es impar');
var transverser = function(obj) {
var result = [];
var pusher = function(str, arr) {
arr.forEach(function(obj) {
if (obj.perms) return pusher(str + obj.value, obj.perms);
result.push(str + obj.value);
});
};
@sorribas
sorribas / phantom-process.js
Created June 13, 2014 12:31
New Phantom process.
// Code to be run by PhantomJS.
// The docs for these modules are here: http://phantomjs.org/api/
// Note that the 'fs' module here has a different API than the one in node.js core.
var webpage = require('webpage');
var system = require('system');
var fs = require('fs');
var page = webpage.create();
var inc = 0;
@sorribas
sorribas / main.c
Created May 26, 2014 14:59
Magick Wand API example
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <wand/magick_wand.h>
void read_file(char** contents, int* length) {
int size;
FILE *input_file = fopen("Eduardo.png", "rb");
fseek(input_file, 0, SEEK_END);
size = ftell(input_file);
var fs = require('fs');
var cp = require('child_process');
var stream = require('stream');
var thunky = require('thunky');
var os = require('os');
var path = require('path');
var afterAll = require('after-all');
var xtend = require('xtend');
var once = require('once');
var http = require('http');