Skip to content

Instantly share code, notes, and snippets.

View tehsis's full-sized avatar
🎯

Pablo Terradillos tehsis

🎯
View GitHub Profile
function run() {
setTimeout(function () {
backupOperation().then(run)
}, 6000);
}
run()
package main
import (
"image"
"image/color"
"image/png"
"math/cmplx"
"math/rand"
"os"
)
const fs = require('fs');
const componentName = process.argv[2];
console.log(`Creating Component: ${componentName}`);
const ComponentTemplate =
`import React from 'react';
import styled from 'styled-components';
@tehsis
tehsis / cluster.js
Created October 17, 2018 16:40
Cluster setup for Auth0 Scalability Workshop @ NodeConf 2018
const os = require('os')
const cluster = require('cluster')
if (cluster.isMaster) {
os.cpus().forEach((cpu) => {
const worker = cluster.fork()
console.log(`Forked worker: ${worker.id}`)
})
} else {
require('./lib/server')

Keybase proof

I hereby claim:

  • I am tehsis on github.
  • I am tehsis (https://keybase.io/tehsis) on keybase.
  • I have a public key whose fingerprint is F2A2 4F5D 020D 46DE 356D 5B3E 95A7 4D98 A467 83B0

To claim this, I am signing this object:

const co = require('q').spawn;
// const co = require('co');
function wait (ms, value) {
return new Promise((resolve, reject) => {
if (typeof ms !== 'number') {
return reject(new Error('arg must be a number'));
}
setTimeout(() => {
resolve(value);
// Gets charachter map from http://unicode.org/charts/charindex.html
var fs = require('fs');
var request = require('superagent');
var cheerio = require('cheerio');
var map = {};
request.get('http://unicode.org/charts/charindex.html')
.end(function(res) {
@tehsis
tehsis / gist:9611922
Created March 18, 2014 01:31
Using webinstaller with requirejs
require(['./app/vendors/webinstaller/webinstaller'], function(Webinstaller) {
var installer = new Webinstaller('http://localhost/manifest.webapp');
var install_button = document.getElementById('instalar');
install_button.addEventListener('click', function() {
installer.install();
}, false);
});
var foo = ["one", "two", "three", "four"];
foo.forEach(function(value, index) {
var xhr = new XMLHttpRequest();
xhr.open('GET', '/ajax');
// Save the element's index to which this request is
// related to.
xhr.index = index;
@tehsis
tehsis / install.js
Created July 11, 2013 10:05
example for tehsis.com.ar
var installer = new WebInstaller("http://localhost:8000/alarm.webapp");
var installBtn = document.getElementById("install");
installBtn.addEventListener("click", function() {
installer.install();
}, false);