Skip to content

Instantly share code, notes, and snippets.

View quangnd's full-sized avatar
💭
Obsidian hooker :")

Nguyen Dang Quang quangnd

💭
Obsidian hooker :")
View GitHub Profile
@quangnd
quangnd / gist:198eb8e7c8f17fca00a11bae36977bc3
Created July 30, 2016 13:13 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@quangnd
quangnd / ReactBindingApproaches.js
Created August 30, 2016 08:06 — forked from coryhouse/ReactBindingApproaches.js
React Binding Approaches
// Approach 1: Use React.createClass
var HelloWorld = React.createClass({
getInitialState() {
return { message: 'Hi' };
},
logMessage() {
// this magically works because React.createClass autobinds.
console.log(this.state.message);
},
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@quangnd
quangnd / states_hash.json
Created December 14, 2016 11:40 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@quangnd
quangnd / README.md
Created March 6, 2017 10:01 — forked from alber70g/README.md
Visual Studio Code (VS Code) shell script for use with Git Bash

VS Code Shell Shortcut for Git Bash

Put this file code in C:\Users\<username>\AppData\Local\Code\bin aside code.cmd.

Assuming this path is already in your %PATH% you can now run the command to open a file

code file.txt
@quangnd
quangnd / README.md
Created March 5, 2018 04:17 — forked from leonardofed/README.md
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.


# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@quangnd
quangnd / commit-msg
Created March 27, 2018 08:15 — forked from jhartikainen/commit-msg
ESLint git commit hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.js$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
echo $files | xargs eslint
@quangnd
quangnd / youtube-dl-download-pluralsight-videos.md
Created March 31, 2018 03:57 — forked from ivanskodje/youtube-dl-download-pluralsight-videos.md
youtube-dl for downloading pluralsight videos

Downloading Videos from Pluralsight

Disclaimer

Pluralsight do not permit users to download their videos.
If you are an user of pluralsight you have agreed with their ToS,
and are thusly refrained from doing so.
Use this knowledge at your own risk.

youtube-dl for Windows

# Centos 7.3 comes with 1.8.3
# so update git from centos repo
yum update git
# it shows nothing to update
# we download git source and build and install latest git on Centos 7.3