This file contains hidden or 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 axios = require('axios') | |
const fs = require('fs') | |
const stream = require('stream') | |
const { promisify } = require('util') | |
const finished = promisify(stream.finished) | |
const download = async (url) => { | |
const response = await axios | |
.get(url, { responseType: 'stream' }) |
This file contains hidden or 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
page.evaluate( () => { | |
function onStartedDownload(id) { | |
console.log(`Started downloading: ${id}`); | |
} | |
function onFailed(error) { | |
console.log(`Download failed: ${error}`); | |
} |
This file contains hidden or 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
/** | |
* create a link and force download | |
*/ | |
function forceDownload () { | |
var a = document.createElement('a'); | |
var url = window.URL.createObjectURL(data); | |
a.href = url; | |
a.download = 'myfile.pdf'; | |
document.body.append(a); | |
a.click(); |
This file contains hidden or 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
title="something horrible!" | |
encodedtitle=`echo "$title" | jq -s -R -r @uri` | |
# need to install URI::Escape | |
#perl -MURI::Escape -e 1 | |
#if [ $? != 0 ]; | |
#then | |
# echo "installing dependencies" | |
# PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'install URI::Escape' |
This file contains hidden or 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
" Press F2 during insert mode to enable or disable the set paste, when paste code from external non console sources | |
set pastetoggle=<F2> | |
" para el javascript indent | |
"let g:js_indent_log = 0 | |
" Only do this part when compiled with support for autocommands. | |
if has("autocmd") | |
" Enable file type detection. | |
" Use the default filetype settings, so that mail gets 'tw' set to 72, |
This file contains hidden or 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
# vi:syntax=sh | |
# enable color support of ls and also add handy aliases | |
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep -n --color=auto' |
This file contains hidden or 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
# git log deferences and pretty print to commit description | |
git log development ^master --pretty=oneline --abbrev-commit --no-merges |
This file contains hidden or 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
'use strict'; | |
var FileActions = { | |
create: function(data,source){ | |
App.EventsDispatcher.dispatch({ | |
actionType: App.Constants.FILE_CREATE, | |
properties: data, | |
source: source | |
}); | |
}, |
This file contains hidden or 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
/** | |
* @author Facugon | |
* Simple socket connector. | |
* how to use | |
* | |
* // connect sockets and start listening to events | |
* SocketsConnector({ | |
* io: window.io, | |
* channel:'/socket/subscribe', | |
* query: { |
NewerOlder