Skip to content

Instantly share code, notes, and snippets.

@clonn
clonn / node_ruby_install.sh
Last active December 5, 2023 04:11
node.js installation and ruby installation, shell.
#!/bin/sh
#need to install redis and mysql
# MacOS env
brew install redis
brew install mysql
brew install zmq
cd ~/
@clonn
clonn / jsoup web parse android intelliJ.md
Last active August 29, 2015 13:57
android parse web page - jsoup. use in intelliJ IDE, 用來抓網頁使用,主要處理 query URL, DOM parsing.

#android parse web page - jsoup. use in intelliJ IDE

now you can parse web page like jQUery, "jsoup".

##install jsoup,

Download jsoup jar, and import to your project. save jsoup.jar in libs folder in your project.

@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.

@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 / 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 / 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 / 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 / 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 / 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();
});
# 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/>