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
/** list of mock File elements to pass the input[file] */ | |
export function getBrowsedFiles(): FileList { | |
return fileListFromArray([ | |
mockFileCreator({ name: 'file-one.png', type: 'image/png', size: 234 * 1000 }), | |
mockFileCreator({ name: 'file-two.gif', type: 'image/gif', size: 56 * 1000 }), | |
]); | |
} | |
export function mockFileCreator({ | |
name = 'file.txt', |
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
#!/bin/bash | |
# Copied from: https://raw.githubusercontent.com/wardviaene/jenkins-course/master/scripts/install_jenkins.sh | |
# Updated with : https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
# this script is only tested on ubuntu xenial and bionic | |
# sudo is only if you are not on root (you should not be on root) | |
# Uninstall previous versions of docker | |
sudo apt-get remove docker docker-engine docker.io containerd runc | |
sudo apt-get update |
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
# Windows only: Don't forget how to build and start Flyimg in windows 10 home environment with Cmder (conEmu) | |
# Must have virtualbox installed, ideally through docker toolbox | |
# do this only once | |
docker-machine create --driver virtualbox default | |
# all the subsequent times, only this | |
docker-machine start default | |
# hook the virtual env to docker |
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 fs = require("fs"); | |
const fsPromises = require("fs").promises; | |
/** | |
* Util function we will reuse to check if the caught error is simply a "not found" error | |
* | |
* @param {*} err | |
* @returns {boolean} | |
*/ | |
function isErrorNotFound(err) { |
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 fileHash = crypto.createHash('md5').update(fileContents).digest('hex'); |
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
// you can load the har however you like. | |
var har = 'paste json har content here'; | |
har.log.pages.forEach(item => { | |
item.data = har.log.entries.find(element => { | |
return element.request.url == item.title; | |
}); | |
console.log(JSON.stringify(item.data)); | |
}) |
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
// script para scrape de registro civil | |
var elAno = '2017'; | |
var request = new XMLHttpRequest(); | |
var nuevoLin = undefined; | |
var saltarLin = undefined; | |
request.onreadystatechange = function () { | |
if (request.readyState === 4 && request.status === 200) { | |
//console.log('volvió! con:',request.responseText) | |
var eldiv = document.createElement('div'); | |
var laMarca = request.responseURL.split('/PrimerasBUS_').pop().split('_'+elAno+'.')[0]; |
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
#cloud-config | |
users: | |
- name: leopold | |
groups: sudo | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
package_upgrade: true | |
packages: | |
- git | |
- docker.io |
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
#!/bin/bash | |
# | |
# Commented provisioning script for a flyimg server | |
# Created for Ubuntu 16 but works with 14 and possibly with other distributions | |
# This script is intended to be used as a root user | |
# This script should be ideally invoqued by a Cloud-init script | |
# Read more at: https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting#run-arbitrary-commands-for-more-control | |
# | |
# Original Gist at: https://gist.github.com/baamenabar/2a825178318d27fc20abfe5a413b45eb | |
# Author B. Agustin Amenabar L. @iminabar |
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
/** | |
* for each item in the array, call a function, but only after the previous has called the callback. | |
**/ | |
function consecutive (list, task) { | |
var count = 0; | |
function step() { | |
var item = list[count]; | |
//console.log(count++); | |
if(typeof item === 'undefined') { |
NewerOlder