Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hooman Amin aminsource

🎯
Focusing
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
@aminsource
aminsource / simple.js
Created Apr 9, 2020
Scope and Clousure in Javascript
View simple.js
var name = "ali"
if (name === "ali"){
var department = "Software"
}
console.log(name); // "ali"
console.log(department) //"software"
@aminsource
aminsource / simple scope
Last active Apr 9, 2020
Scope and Closure in Javascripw
View simple scope
var name = "ali"
if (name === "ali"){
var department = "Software"
}
console.log(name); // "ali"
console.log(department) //"software"
View npmcrashcourse.txt
# GET VERSION
npm -v (or --version)
# GET HELP
npm help
npm
# CREATE PACKAGE.JSON
npm init
npm init -y (or --yes)
@aminsource
aminsource / cookie.js
Created Apr 26, 2019 — forked from thoov/cookie.js
Javascript Cookie Functions
View cookie.js
View install-mongodb-on-centos7.snippets
# https://www.howtoforge.com/tutorial/how-to-install-and-configure-mongodb-on-centos-7/
# from:https://quicktechnotes.wordpress.com/2017/01/02/how-to-install-mongodb-elasticsearch-and-graylog-on-centos-7/
# Install EPEL
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install pwgen
sudo yum -y update
# Add mongodb repo.
@aminsource
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: http://git.mikaelb.net/presentations/bartjs/destructuring
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
aminsource / vscode_shortcuts.md
Created Mar 1, 2019 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode
View vscode_shortcuts.md

VSCode Shortcuts

List of helpful shortcuts for faster coding

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

Official List of all commands

View graphql-cheat-sheet.md

GraphQL Cheat Sheet

Overview

  • 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
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);
You can’t perform that action at this time.