Skip to content

Instantly share code, notes, and snippets.

@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];
@clonn
clonn / node_install.sh
Last active May 12, 2016 01:24
node.js v4.2.2 install on Koding.com
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install v4.2.2
nvm alias default v4.2.2
nvm use default
# install other service
npm install -g sails
npm install -g gulp
@clonn
clonn / index.js
Created October 27, 2015 08:48
express.js route index.js route config
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
var users = {
@clonn
clonn / steps-1.md
Created October 6, 2015 09:00
create koding server

steps

term

cd Web/
touch server.js

server.js

@clonn
clonn / buffer2Stream.js
Created June 27, 2015 14:39
buffer2Stream
var stream = require('stream');
// Initiate the source
var bufferStream = new stream.PassThrough();
// Write your buffer
bufferStream.end(new Buffer('Test data.'));
// Pipe it to something else (i.e. stdout)
bufferStream.pipe(process.stdout);
@clonn
clonn / youtube-player.coffee
Created January 3, 2015 09:48
youtube-player.coffee, for controller, should be install and use, could not insert before.
(($) ->
options =
videoId: "youtube video id"
width: "640"
height: "480"
playerVars:
autoplay: 0
controls: 1
modestbranding: 0

How to set up Gulp with an ExpressionEngine project

I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).

Install Node.js

  • If Node is not yet installed on the machine, it will need to be installed

Install Gulp (if needed)

@clonn
clonn / gist:dc9d523910d82fef5e64
Last active August 29, 2015 14:12
bath to converting whole project to CoffeeScript with js2coffee
#!/bin/bash
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './components' -prune`
do
if [ -e $FILE ] ; then
COFFEE=${FILE//.js/.coffee}
echo "converting ${FILE} to ${COFFEE}"
js2coffee "$FILE" > "$COFFEE"
else
@clonn
clonn / readme.md
Last active August 29, 2015 14:10 — forked from max-mapper/readme.md
io.js 非官方聲明,中文版本

聲明: 此並非爲官方聲明。我並非爲 io.js 官方代表,如果有任何問題,歡迎在 node-forward 一起討論

io.js - what you need to know

io-logo-substack

  • io 內容主要會從 node v0.12 分支出來 ( node v0.12 是下一個正式版本,但是尚未釋出)
  • io.js 將會 完全相容 於 node.js
  • io.js 開發者大多於 node.js 核心貢獻者,這邊有關於 io.js 想法以及運作方針