Skip to content

Instantly share code, notes, and snippets.

View iamblue's full-sized avatar

Blue Chen iamblue

View GitHub Profile
<div ng-repeat="c in commentdata" style="margin-top:-9px">
<div proccess-frame
step="{{ c.step }}"
steptitle="{{ c.commentTitle }}"
steppicurl = "{{ c.commentPicUrl }}"
stepcontent="{{ c.commentContent }}"
steponvotetime="{{ c.stepOnVoteTime }}"
stepdownvotetime="{{ c.stepDownVoteTime }}"
createdat="{{ c.createdAt | date:'yyyy-MM-dd' }}">
</div>
const proccessFrameDirective = ($timeout)->
{
retrict: \A
templateUrl: "/views/layout/project/item/comment.html"
link: (scope, elem, attr) !->
$timeout ->
scope.commentarr.push elem[0]offsetHeight
,100
scope.steparr.push Number(attr.step)
switch attr.step
var s3 = new AWS.S3();
var _now = new Date();
var sArray = req.files.file.name.split(/(.jpg|.gif|.png|.jpeg)/);
var _re = crypto.createHash('md5').update(sArray[0]+_now).digest("hex");
_re = _re+sArray[1];
fs.readFile('/'+req.files.file.path, function (_err, data) {
var params = {Bucket: 'limitstyle',Key:_re,Body:data,ACL: 'public-read'};
s3.putObject(params, function (err, data) {
if (err) {
} else {
;(function(window, $$){
'use strict';
var page = $$.create({
className: 'content',
autoSectionHeight: false
});
page.section(0, function (section) {
<html>
<head>
<title>聯發科</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>
<header></header>
<div id="section" class="content">
<div class="section-one__content"></div>
<div class="section-one__frame">
uploader = $fileUploader.create(
scope: $scope
url: "http://#{$rootScope.api}/proposal/upload"
formData: [{
key: \value
}]
filters: [
(item) ->
if item.size >10000000
alert \size不得超過10mb
//js
s3 = new aws-sdk.S3({
credentials:{
accessKeyId: $mtk.config.S3.accessKeyId,
secretAccessKey:$mtk.config.S3.secretAccessKey
}
,endpoint: $mtk.config.S3.endpoint
})
//livescript
@iamblue
iamblue / config.json
Last active August 29, 2015 14:06
mtk framework config
{
"livereload" : 35729,
"PORT" : 3000,
"csrf": { // 是否要有csrf功能
"active": false,
"ignoreMethods" : [ "POST", "GET", "HEAD", "OPTIONS", "DELETE", "PUT" ]
},
"cookieSession": "mtkcookies", //設定你的cookie session
"redis":{ //設定你的redis
"host":"localhost",
@iamblue
iamblue / ls.js
Created September 26, 2014 02:14
//backcall
$http.get("http://#{api}/test/all").success(function(json){
openFile(function(filename){
saveJsonToFile(filename, json);
});
})
json <- $http.get "http://#{api}/test/all".success //json 從這裡來
filename <- openfile //filename 從這裡來
saveJsonToFile filename, json
@iamblue
iamblue / demo.js
Last active August 29, 2015 14:07
Ugly Javascript.
[ 1, 2, 3 ] + [ 4, 5, 6 ]
// '1,2,34,5,6'
// 奇怪的點:
// 1. array跟array 怎會是 string
// 2. 那個 + 到底是數值相加 還是 [1,2,3,4,5,6] ?