This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if _VERSION == "Lua 5.1" then | |
table.unpack = unpack | |
table.pack = function(...) return {...} end | |
end | |
local definir_dato = function(claves) | |
return function(valores) | |
local estructura = {} | |
if #claves > #valores | |
then error("No se proporcionó la cantidad de argumentos necesaria") end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _mt = { | |
__call = function(t, ...) | |
-- Los primeros table.dimensiones argumentos corresponden a la | |
-- ubicación en cada eje | |
local argumentos = table.pack(...) | |
local dimensiones = #t.dimensiones | |
local indice_set_value = dimensiones + 1 | |
local indice_set_nil = dimensiones + 2 | |
local indice = 0 | |
for i = 1,dimensiones do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Información global de diarios | |
/ | |
Historial del global | |
/historial/ | |
Parámetros: | |
incluir_diffs | |
pagina: <num> | |
max: <num> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Se puede probar con http://repo.huayra.conectarigualdad.gob.ar/huayra/dists/unstable/main/binary-amd64/Packages | |
function parse_package(text) { | |
'use strict'; | |
const regex = { | |
field: /([^:\n]+): ([^\n]+)\n((:? [^\n]*\n)*)/g, | |
package: /(:?[^\n]+\n)+\n/g | |
} | |
var result = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function draw(screen) { | |
for(var i = 0; i < 640 * 480; i++) { | |
var r = screen[i * 3 + 0]; | |
var g = screen[i * 3 + 1]; | |
var b = screen[i * 3 + 2]; | |
var idx = (r + g + b) - (r + g + b) % 3; | |
imgdata.data[i * 4 + 0] = screen[i * 3 + idx + 0]; | |
imgdata.data[i * 4 + 1] = screen[i * 3 + idx + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shntool split -t "%n - %t" -o flac -m "/ :-? " -f <cuefile> <audiofile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {createInterface} = require('readline') | |
const {get} = require('http') | |
const {join, parse} = require('path') | |
const cmd = createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
historySize: 2000, | |
prompt: 'cpcipc>' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'ember-cat', | |
cats: [30, 40, 200], | |
log(thing) { | |
console.log(thing); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This can be useful with co | |
* | |
* Example: | |
* co.wrap(function* listenChanges(dir, warnlist) { | |
* const watch = fs.watch(dir); | |
* const changes = eventIterator(watch, 'change'); | |
* for(change of changes) { | |
* let [event, file] = yield change; // co will wait the Promise for us | |
* if(file in warnlist) | |
* console.info('[WARN] the file %s has %s', file, event); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Returns a function that can only be called once (useful for faulty libs) */ | |
function only_one(f) { | |
return function single_call(...args) { | |
if(f) { | |
let rval = f(...args); | |
f = null; | |
return rval; | |
} else { | |
return null; | |
} |
OlderNewer