Skip to content

Instantly share code, notes, and snippets.

@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 學員,如果在以下環境安裝中遇到任何問題,歡迎直接來信給我 clonncd@gmail.com

預先安裝

  • 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;
}
}
@clonn
clonn / preinstall_ubuntu.sh
Last active June 9, 2023 15:10
preinstall.sh for ubuntu 14.04
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install git -y
sudo apt-get install wget -y
sudo apt-get install curl -y
sudo apt-get install nginx -y
sudo apt-get install gcc -y
sudo apt-get install g++ -y
@clonn
clonn / twilio_sms_sender.js
Created March 17, 2016 11:29
twilio sms sender node.js simple code.
// Your accountSid and authToken from twilio.com/user/account
var accountSid = 'AUTH_SID';
var authToken = "AUTH_KEY";
var client = require('twilio')(accountSid, authToken);
var text = "TEXT_CONTENT";
var users = [--phone number array-];
for (var i=0;i<users.length ; i ++) {
var sender = "+886" + users[i];