Skip to content

Instantly share code, notes, and snippets.

Avatar

Gustavo Henke gustavohenke

View GitHub Profile
View windows_restart.sh
# Put me in your .bash_profile and enjoy rainy days reinstalling deps
windows_restart() {
rm -rf node_modules
if [ -f "yarn.lock" ]; then
yarn
else
npm install
fi
}
View keybase.md

Keybase proof

I hereby claim:

  • I am gustavohenke on github.
  • I am gustavohenke (https://keybase.io/gustavohenke) on keybase.
  • I have a public key whose fingerprint is 1FFB E83F 4C57 C8D0 A65C 4388 7A48 53C4 38D5 C9BB

To claim this, I am signing this object:

@gustavohenke
gustavohenke / collect-angular-scopes.js
Last active Dec 28, 2019
Collect all Angular.js scopes
View collect-angular-scopes.js
function collect( element ) {
var scope;
var watchers = [];
element = angular.element( element );
scope = element.data("$scope");
if ( scope ) {
watchers = scope.$$watchers || watchers;
}
View svg2png.js
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
You can’t perform that action at this time.