Skip to content

Instantly share code, notes, and snippets.

View robertoentringer's full-sized avatar
🖥️
Working from home

Roberto Entringer robertoentringer

🖥️
Working from home
View GitHub Profile
@robertoentringer
robertoentringer / convert-seconds.js
Created April 13, 2019 03:42 — forked from martinbean/convert-seconds.js
Convert seconds to HH:MM:SS format in JavaScript.
new Date(seconds * 1000).toISOString().substr(11, 8)
@robertoentringer
robertoentringer / splitter.js
Created April 13, 2019 14:38 — forked from nlac/splitter.js
A small js snippet to split a merged audio track to parts by silence analysis. Based on ffmpeg "silencedetect" filter and node.js.
/**
* This javascript snippet is able to split a merged audio track to parts by silence analysis
* It is based on ffmpeg (https://ffmpeg.org), especially on the silencedetect filter (https://ffmpeg.org/ffmpeg-filters.html#silencedetect)
*
* Assumptions:
* - nodejs is installed
* - ffmpeg is installed
*
* Usage:
* - fill the options object
@robertoentringer
robertoentringer / chrome-i18n.js
Created May 6, 2019 13:28 — forked from eligrey/chrome-i18n.js
Easy i18n for your Chrome extensions and apps' DOM.
/* Chrome DOM i18n: Easy i18n for your Chrome extensions and apps' DOM.
* 2011-06-22
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*jslint laxbreak: true, strict: true*/
/*global self, chrome, document*/
@robertoentringer
robertoentringer / git-clearHistory
Created May 6, 2019 17:55 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
@robertoentringer
robertoentringer / index.js
Created May 7, 2019 15:04 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@robertoentringer
robertoentringer / remote_bash.sh
Created May 11, 2019 23:58 — forked from n0ts/remote_bash.sh
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
@robertoentringer
robertoentringer / node-and-npm-in-30-seconds.sh
Created June 17, 2019 14:38 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@robertoentringer
robertoentringer / destructuring.js
Created July 3, 2019 18:29 — forked from mikaelbr/destructuring.js
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@robertoentringer
robertoentringer / git-update-fork.sh
Created July 4, 2019 16:57 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@robertoentringer
robertoentringer / GIF-Screencast-OSX.md
Last active July 10, 2019 23:59 — forked from baumandm/GIF-Screencast-OSX.md
OS X Screencast to Animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.

Forked from https://gist.github.com/baumandm/1dba6a055356d183bbf7. Updated to facility the usage.

Instructions

Add the following function in your .bash_profile :