Skip to content

Instantly share code, notes, and snippets.

@clonn
clonn / index.js
Last active February 22, 2017 06:24
test for node v7.6.0
var request = require('superagent');
async function getRequest() {
let body = await request('http://www.google.com');
return body;
}
async function run() {
let result = await getRequest();
console.log(result.text);
@clonn
clonn / study_nvm.md
Last active July 29, 2018 13:59
node_nvm_for_windows
@clonn
clonn / index.html
Last active October 22, 2016 08:43
webpack init config
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>Hello Webpack</h1>
<script src="bundle.js"></script>
</body>
@clonn
clonn / 01-README.md
Created September 18, 2016 06:52 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@clonn
clonn / remove_complete_mariaDB.sh
Last active May 21, 2021 14:59
remove complete mariaDB in ubuntu 14.04
sudo apt-get remove mariadb-server
sudo apt-get remove --auto-remove mariadb-server
sudo apt-get purge mariadb-server
sudo apt-get purge --auto-remove mariadb-server
@clonn
clonn / monitor_restart.sh
Created August 28, 2016 14:55
continue run script and auto restart in one line.
while true; do echo 'run script'; sh ./run.sh; done
@clonn
clonn / sailsjs_cli.md
Last active July 27, 2016 09:41
sails new a project
npm install -g sails
npm install -g grunt-cli
npm install -g bower
sails new demo
cd demo
@clonn
clonn / front_end_test_flow.md
Last active July 28, 2016 23:38
e2e 測試環境安裝指令

e2e 安裝環境,

建議使用 Unix 環境進行本次課程, 如果是 Windows 學員,如果在以下環境安裝中遇到任何問題,歡迎直接來信給我 [email protected]

預先安裝

  • node.js v4.4.5
  • npm (安裝完上面的 node.js 會提供 npm 的指令)
@clonn
clonn / preinstall_mac.sh
Last active January 2, 2022 22:32
install mac environment and script
brew update
brew upgrade
brew install git
brew install wget
brew install curl
brew install nginx
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
. ~/.nvm/nvm.sh
@clonn
clonn / loop_return.js
Created April 21, 2016 08:54
test for loop and return
var s= 10;
for(var i=0; i<=s; i++) {
console.log('run' + i);
try {
if (i===1) { return console.log('run end');}
} catch(e) {
return e;
}
}