Skip to content

Instantly share code, notes, and snippets.

@clonn
clonn / send_mail.coffee
Created April 13, 2013 00:24
Node.js, Send mail by Gmail. it is a simple code in Coffee Script, a full content for Node.js Taiwan Community contributor.
nodemailer = require 'nodemailer'
fs = require 'fs'
_sendMail = (email, code) ->
contentHtml = [
"親愛的 Node.js 台灣社群朋友,"
"<p>"
"由於你的支持,社群活動才能夠得以持續進行,因此特別送上 JSDC 邀請碼,"
"<br/>"
"<br/>"
@clonn
clonn / org.redis.redis-server.plist
Created April 23, 2013 05:25
redis-server plist in MacOS, can check my blog, http://blog.caesar.com
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.redis.redis-server</string>
<key>Program</key>
<string>/usr/local/bin/redis-server</string>
<key>ProgramArguments</key>
# 1. Create a new file at /Library/LaunchDaemons/org.mongo.mongod.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mongo.mongod</string>
<key>RunAtLoad</key>
<true/>
@clonn
clonn / net.js
Created June 4, 2013 09:56
dynamic callback answer example
fs = require('fs');
var sandbox = {};
vm.runInNewContext(data, sandbox);
socket.on('data',function(data){
// after proccessed data, left the callback function name.
callback = JSON.parse(fs.readFileSync('./' + data));
callback.fn();
});
@clonn
clonn / routeDeploy.js
Last active March 7, 2021 08:01
Node.js with Express, deploy through web hook. this is route part code.
var exec = require('child_process').exec;
var set = function (app) {
app.post('/deploy', function (req, res) {
var feedback;
var branch = 'master';
try {
feedback = JSON.parse(req.body.payload);
@clonn
clonn / nvm_install.sh
Last active May 29, 2019 04:40
node install flow by nvm
# linux or mac
cd ~/
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
cat ~/.nvm/nvm.sh >> ~/.bashrc
source ~/.nvm/nvm.sh
nvm install v10.15.3
nvm use v10.15.3
nvm alias default v10.15.3
@clonn
clonn / npm_plugin_install.sh
Last active December 23, 2015 06:09
node.js command line usage cli tool, one line install * express * grunt, grunt-init * bower * coffee-script
npm install -g express grunt-init grunt bower coffee-script js2coffee
@clonn
clonn / User.js
Last active December 31, 2015 09:58
talk for user login, demo for ncue
// Path: /api/models/user.js
module.exports = {
attributes: {
/* e.g.
nickname: 'string'
*/
username: "string",
@clonn
clonn / Setting android in intelliJ IDE.md
Last active August 29, 2015 13:57
setting android environment in IntelliJ IDE, 設定 intelliJ IDE 的方法,以及實際遇到的問題, include android sdk, jdk setting.
@clonn
clonn / Failure [INSTALL_FAILED_OLDER_SDK].md
Last active August 29, 2015 13:57
intellij deploy to genymotion got error, Failure [INSTALL_FAILED_OLDER_SDK], 當執行發生錯誤的時候,解決方法

#when genymotion runs error.

After a lots setting, we can start intellij with genymotion.

if you face executed ERROR, message like this,

Failure [INSTALL_FAILED_OLDER_SDK]

##make sure you ADV version.