Skip to content

Instantly share code, notes, and snippets.

@iManu
iManu / Random-string
Created October 12, 2018 08:38 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@iManu
iManu / node-and-npm-in-30-seconds.sh
Created August 22, 2017 08:53 — 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
@iManu
iManu / node-and-npm-in-30-seconds.sh
Created August 22, 2017 08:53 — 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
var $ = document.querySelectorAll.bind(document);
var $_ = document.querySelector.bind(document);
@iManu
iManu / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@iManu
iManu / _inline-block.scss
Last active August 29, 2015 14:06 — forked from jlong/_inline-block.scss
SCSS: inline-block
/*
Inline-block for IE6, Firefox 2, and up
via http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block
*/
@module inbl {
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
*display: inline;