Skip to content

Instantly share code, notes, and snippets.

View wubin1989's full-sized avatar

武斌 wubin1989

View GitHub Profile
@wubin1989
wubin1989 / setup-sublime3-for-angular2.md
Created January 10, 2017 01:54 — forked from dwmkerr/setup-sublime3-for-angular2.md
Quickly setup Sublime Text 3 for Angular 2

Quick Setup for Sublime Text 3 for Angular 2

Easy to remember, easy to forget.

Step 1: Download Sublime Text 3

Sublime Text 3 Download

Step 2: Create a bash shortcut

It's nice to be able to run subl in a terminal.

@wubin1989
wubin1989 / MySQL.md
Created January 14, 2017 16:18 — forked from nrollr/MySQL.md
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

@wubin1989
wubin1989 / docker-toolbox_uninstall.sh
Created January 20, 2017 14:16 — forked from lishenzhi/docker-toolbox_uninstall.sh
docker toolbox uninstall
#!/bin/bash
# source: https://github.com/docker/toolbox/blob/master/osx/uninstall.sh
# Uninstall Script
if [ "${USER}" != "root" ]; then
echo "$0 must be run as root!"
exit 2
fi
@wubin1989
wubin1989 / mysql-docker.sh
Created March 22, 2017 16:55 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@wubin1989
wubin1989 / mdeditor.html
Last active March 23, 2017 05:45 — forked from DerekTBrown/mdeditor.html
Simple Markdown Editor with Angular2
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<textarea #simplemde></textarea>
@wubin1989
wubin1989 / elasticsearch-term-frequency.sh
Created June 3, 2017 02:59 — forked from nz/elasticsearch-term-frequency.sh
In Elasticsearch, how do I get a list of the top 10 most frequently occurring values of a field?
#!/bin/sh
test_document="{
\"text\": \"HEAR the sledges with the bells, / Silver bells! / What a world of merriment their melody foretells! / How they tinkle, tinkle, tinkle, / In the icy air of night! / While the stars, that oversprinkle / All the heavens, seem to twinkle / With a crystalline delight; / Keeping time, time, time, / In a sort of Runic rhyme, / To the tintinnabulation that so musically wells / From the bells, bells, bells, bells, / Bells, bells, bells— / From the jingling and the tinkling of the bells.\"
}"
if curl -fs -X HEAD localhost:9200/top-terms; then
echo "Clear the old test index"
curl -X DELETE localhost:9200/top-terms; echo "\n"
fi
@wubin1989
wubin1989 / ubuntu_agnoster_install.md
Created July 13, 2017 02:13 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 14.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@wubin1989
wubin1989 / install_monaco_font.sh
Created July 13, 2017 06:59 — forked from rogerleite/install_monaco_font.sh
Install Monaco font in Linux
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@wubin1989
wubin1989 / bignumber.js.d.ts
Created August 20, 2017 12:28 — forked from cybrown/bignumber.js.d.ts
Starting web3 TypeScript type definition
declare module "bignumber.js" {
class BigNumber {
constructor(value: number|string); // Acccepts a number OR a string
toNumber(): number;
// Those static attributes could have been in the module, a few lines beneath
static ROUND_DOWN: any;
static config(arg: any): void;
}
var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();