Skip to content

Instantly share code, notes, and snippets.

@allenyang79
allenyang79 / child_process.js
Created September 4, 2013 06:43
node js child_process test
var child= require('child_process');
child.exec('ls -lh /usr', function(err, stdout, stderr) {
child.exec('ls -lh /usr', function(err, stdout, stderr) {
console.log(stdout);
});
console.log(stdout);
});
@allenyang79
allenyang79 / jsbin.OgEdExo.css
Created October 3, 2013 04:17
simple angularjs + coffescript
.done-true {
text-decoration: line-through;
color: grey;
}
@allenyang79
allenyang79 / flot-js-line-chart.markdown
Created October 10, 2013 14:43
A Pen by allenyang.
@allenyang79
allenyang79 / Vector2D
Created October 19, 2013 09:51
向量運算
package com.rocketmandevelopment.math {
import flash.display.Graphics;
/**
* 2D vector class
*/
public class Vector2D {
private var _x:Number;
private var _y:Number;
@allenyang79
allenyang79 / A-Pen-by-allenyang.markdown
Last active December 26, 2015 05:29
angular +bootstrap datetime picker
@allenyang79
allenyang79 / jsbin.eWOCECa.coffee
Last active December 26, 2015 17:08
test angular to parse @ attribute $eval and @parse
app=angular.module "app",[]
app.controller "Ctrl",($scope)->
console.log "Ctrl start"
$scope.heroName="susus"
app.directive "hero",()->
return {
restrict:"EA"
template:"""
@allenyang79
allenyang79 / jsbin.eWOCECa.coffee
Last active December 26, 2015 17:09
angular scope isolated Attribute 比較 =,直接綁定到另一個外部變數上 @,用來邦angular 的expression,可以用scope.$eval(attr.var) 來解析 &,用來綁方法
app=angular.module "app",[]
app.controller "Ctrl",($scope)->
console.log "Ctrl start"
$scope.ctrlHeroName="CTRL HERO NAME"
app.directive "hero",()->
return {
scope:
heroName:"="
@allenyang79
allenyang79 / _base.scss
Created October 28, 2013 14:53
compass susy responsive測試
@import "susy";
@import "compass";
//if you want to use the buttons plugin
@import "sassy-buttons";
//this is the default number of columns
$total-columns: 8;
//width of each column
$column-width : 60px;
@allenyang79
allenyang79 / jsbin.aguZOQA.coffee
Last active December 26, 2015 19:29
d3 scale test 測試d3的scale基本用法
svg=d3.select('svg')
.attr('width','250px')
.attr('height','250px')
console.dir d3.select('svg')
data=[{x:35,y:10},{x:15,y:30}]
svg.selectAll('circle')
.data(data)
.enter()
@allenyang79
allenyang79 / jsbin.eWOCECa.coffee
Last active December 26, 2015 19:29
$eval 跟$parse 稍微比較一下 $parse可以分析出一段expression字串反應成一個function 透過$parse回傳再func,apply()來執行 故可將外部scope的method綁入
app=angular.module "app",[]
app.controller "Ctrl",($scope)->
console.log "Ctrl start"
$scope.ctrlHeroName="CTRL HERO NAME"
$scope.doit=()->alert("Go")
app.directive "hero",($parse)->
return {