Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

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
@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);
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
aminsource / myscript.sh
Created Oct 30, 2018 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
View myscript.sh
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@aminsource
aminsource / ssh.md
Created Oct 30, 2018 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets
View ssh.md

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

You can’t perform that action at this time.