Skip to content

Instantly share code, notes, and snippets.

Avatar
❤️
Love & Peace

Alan Dong ldong

❤️
Love & Peace
  • Sunnyvale, CA
View GitHub Profile
View hapi.js-styleguide.md

Coding Conventions

JavaScript

Language

Strict Mode

  • The first line of every file should be 'use strict';. If the file contains a shebang, strict mode should be enabled on the second line.
  • The strict mode directive should be followed by a blank line.
View advanced_string_literal.md
let horse = {age : 10}

function horseAge(str, age){

    const ageStr = age > 5 ? 'old' : 'young';
    return `${str[0]} ${ageStr} at ${age} years`;
}

horseAge`This hourse is ${horse.age}`
View vimrc_2018
" ==============================================================================
" Author: Alan Dong
" Version: 0.3.5
" Last Modified Date: 8/17/2018
" Description: My Vim Configuration file
" ==============================================================================
" set shell for bash as default
set shell=/bin/bash
View zshrc.txt
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@ldong
ldong / cidr.py
Created Apr 5, 2018 — forked from matts80/cidr.py
Python script to calculate CIDR values
View cidr.py
""" Calculate the subnet mask, its binary representation, number of host and
network bits, and the total number of hosts for a given CIDR address.
Usage: python cidr.py [cidr]
Notes: Pipe the command to jq to pretty print the JSON. Python 2 or 3 compatible.
Examples:
python cidr.py 10.0.0.0/24
python cidr.py 172.0.0.0/16 | jq
"""
from __future__ import print_function
@ldong
ldong / README.md
Created Mar 29, 2018 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications
View README.md


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.


View zip-excluding-specific-directories-and-files.md

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*
View Alphabets.txt
Apple
Boy
Cat
Dog
Egg Elephant
Friend Fish
Girl
Hi Hat
India Ice Cream
Judy
View Ember_Expand_Properties_Benchmark_RESULTS.md

$ node index.js
status quo x 183,314 ops/sec ±7.01% (81 runs sampled)
comma fix x 88,004 ops/sec ±5.18% (81 runs sampled)
alternate fix x 88,608 ops/sec ±4.89% (84 runs sampled)
regex match fix x 36,670 ops/sec ±5.04% (83 runs sampled)
iteration fix x 175,519 ops/sec ±5.20% (84 runs sampled)
nested x 88,474 ops/sec ±3.91% (82 runs sampled)

You can’t perform that action at this time.