Skip to content

Instantly share code, notes, and snippets.


Hooman Amin aminsource

Block or report user

Report or block aminsource

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View npmcrashcourse.txt
npm -v (or --version)
npm help
npm init
npm init -y (or --yes)
aminsource / cookie.js
Created Apr 26, 2019 — forked from thoov/cookie.js
Javascript Cookie Functions
View cookie.js
View install-mongodb-on-centos7.snippets
# from:
# Install EPEL
sudo rpm -Uvh
sudo yum -y install pwgen
sudo yum -y update
# Add mongodb repo.
aminsource / destructuring.js
Created Apr 12, 2019 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic:
View destructuring.js
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
View vsc_js_snippets.json
"Console Log": {
"prefix": "cl",
"body": "console.log($1);",
"description": "Console Log"
"Named Function": {
"prefix": "nfn",
"body": ["function ${1:functionName}($2) {", " $3", "}"],
"description": "Named Function"
aminsource /
Created Mar 1, 2019 — forked from bradtraversy/
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

  • For mac, replace "Ctrl" with "cmd" and "Alt" with "option"

Official List of all commands


GraphQL Cheat Sheet


  • An alternative approach to RESTful APIs
  • Clients issue queries/mutations to read and update data
  • Clients can fetch only the entity fields that are required
  • GraphQL query syntax can express complex entity relations => nested objects
  • Mitigates the explosion of RESTful endpoints in scenarios where many different representations of an entity are needed
  • Graphiql is a query execution UI, also provides good documentation
aminsource / gist:319789d12e616b1ce265eba5b76e64e6
Created Nov 10, 2018 — forked from rmurphey/gist:846908
examples of testing with jasmine
View gist:319789d12e616b1ce265eba5b76e64e6
function multiply(a, b) {
return a * b;
function divide(a, b) {
if (b === 0) {
throw "Don't try to divide by zero!";
return Math.round(a / b);
View gist:9a54caa4343241ffe91ba078b233b607

Npm has a lot of commands, lets make a cheat sheet!

Community Features

  • adduser (alias: add-user | login)

    Create or Login into the npm server.

    npm adduser
aminsource /
Created Oct 30, 2018 — forked from bradtraversy/
Basic Shell Scripting
#! /bin/bash
# echo Hello World!
# Uppercase by convention
# Letters, numbers, underscores
# echo "My name is $NAME"
You can’t perform that action at this time.