Skip to content

Instantly share code, notes, and snippets.

Love & Peace

Alan Dong ldong

Love & Peace
  • Sunnyvale, CA
Block or report user

Report or block ldong

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 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.
# Uncomment the following line to use case-sensitive completion.
ldong /
Created Apr 5, 2018 — forked from matts80/
Python script to calculate CIDR values
""" 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]
Notes: Pipe the command to jq to pretty print the JSON. Python 2 or 3 compatible.
python | jq
from __future__ import print_function
ldong /
Created Mar 29, 2018 — forked from leonardofed/
A curated list of AWS resources to prepare for the AWS Certifications

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.


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
Egg Elephant
Friend Fish
Hi Hat
India Ice Cream

$ 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)

void rotate(int **a, int n) {
  if(!a || n<2)
  int mid = n/2;

  for(int i=0; i<mid; ++i) {
    int len = n-1-i;
    for(int j=i; j<len; ++j) {    
import java.util.*;

 * To execute Java, please define "static void main" on a class
 * named Solution.
 * If you need more classes, simply define them inline.
You can’t perform that action at this time.