Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hoàn Đặng hoandang

🎯
Focusing
Block or report user

Report or block hoandang

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
@hoandang
hoandang / laravel-artisan-cheatsheet
Created Aug 24, 2017
Laravel artisan cheatsheet
View laravel-artisan-cheatsheet
clear-compiled Remove the compiled class file
down Put the application into maintenance mode
env Display the current framework environment
help Displays help for a command
inspire Display an inspiring quote
list Lists commands
migrate Run the database migrations
optimize Optimize the framework for better performance
serve Serve the application on the PHP development server
tinker Interact with your application
@hoandang
hoandang / docker-destroy-all.sh
Created Jul 8, 2017 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
View docker-destroy-all.sh
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@hoandang
hoandang / php-docker-ext
Created May 20, 2017
Complete list of php docker ext
View php-docker-ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
View edm.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial,Helvetica Neue,Helvetica,sans-serif;background: #CCC;padding: 0;margin: 0;">
<head style="font-family: Arial,Helvetica Neue,Helvetica,sans-serif;">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>eBay Innovation Lab</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body style="font-family: Arial,Helvetica Neue,Helvetica,sans-serif;background: #CCC;padding: 0;margin: 0;">
<!-- <table style="font-family: Arial,&quot;Helvetica Neue&quot;,Helvetica,sans-serif;border-spacing: 0;background: #FFF;max-width: 900px;margin: 0 auto;"> -->
View ssh-bootstrap.sh
#!/bin/bash
cat > ~/.bash_profile <<EOL
export VISUAL=vim
export EDITOR="$VISUAL"
alias install="sudo apt-get -y install"
alias update="sudo apt-get -y update"
alias upgrade="sudo apt-get -y upgrade"
alias v="vim"
View gulp.js
var
gulp = require('gulp'),
plumber = require('gulp-plumber'),
prefixer = require('gulp-autoprefixer'),
coffee = require('gulp-coffee'),
babel = require('gulp-babel'),
sass = require('gulp-sass'),
gutil = require('gulp-util'),
minify = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
@hoandang
hoandang / preprocessor_fun.h
Last active Aug 29, 2015 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@hoandang
hoandang / introrx.md
Last active Aug 29, 2015 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

View gist:2659d9a1ccfe150776bb

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

View data.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<data>
<row>
<product>Line of Credit Fixed =&lt;$750k</product>
<bank>Macquarie Bank</bank>
<rate>4.690</rate>
<initial_rate_type>F</initial_rate_type>
<initial_rate>4.390</initial_rate>
<initial_rate_period>12</initial_rate_period>
<application_fees>0</application_fees>
You can’t perform that action at this time.