Skip to content

Instantly share code, notes, and snippets.

View iamblue's full-sized avatar

Blue Chen iamblue

View GitHub Profile
<html ng-app="main">
<head>
<style type="text/css">
.active{
color:red;
}
</style>
</head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<title>基本 AngularJS 練習 - JavaScript 與 AngularJS 開發實戰 (Will 保哥)</title>
@iamblue
iamblue / gist:9243372
Created February 27, 2014 02:48
grunt-html-snapshot config
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-html-snapshot');
grunt.initConfig({
htmlSnapshot: {
all: {
options: {
snapshotPath: 'snapshots/',
msWaitForPages: 3000,
urls: ['http://localhost:9000/i/choose','http://localhost:9000/i/shop']
<title>Limitstyle{{title}}</title>
<meta name="description" content="">
<meta property="og:title" content="LimitStyle">
<meta property="og:type" content="website">
<meta property="og:image" content="https://s3-us-west-2.amazonaws.com/dont-throw/limitstyle.jpg">
<meta property="og:url" content="http://www.limitstyle.com">
<meta property="og:description" content="讓創意走出圖紙 將作品變成商品">
<meta name="description" content="讓創意走出圖紙 將作品變成商品">
@iamblue
iamblue / gist:9243989
Created February 27, 2014 03:45
nginx default
server{
#...
if ($http_user_agent ~ (Googlebot|faceboo54kexternalhit)) {
rewrite ^ /seo$uri last;
}
location /seo {
proxy_pass http://localhost:3333;
}
}
@iamblue
iamblue / gist:9244610
Created February 27, 2014 04:55
use nodejs middleware to seperate SEO source
app.use(function(req, res, next) {
var frag = req.query._escaped_fragment_;
if (!frag) return next();
if (frag){
//處理指向的對應route
}
server {
// ....
if ($args ~ "_escaped_fragment_=/?(.+)") {
set $url $1;
rewrite ^ /snapshots/$url last;
}
}
$scope.step1pdata = ->
newdata = []
angular.forEach $scope.pdata, (v,i,o) !->
__tmp =
n : i + 1
id : v.id
productId : v.productId
userId : v.userId
newdata.push __tmp
newdata
@iamblue
iamblue / gist:10399650
Created April 10, 2014 16:28
Sublime-livescript path setting
// vim ~/Library/Application Support/Sublime Text 2/Packages/sublime-livescript/LiveScript.sublime-settings
{
// Path to livescript. Defaults to sublime's path
"livescript_path": "/usr/local/bin/",
// The actual binary.
"livescript_bin": "/usr/local/bin/lsc"
}
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
<div class="process-timeline" ng-show="cstep == 0">
<div class="date">
<div class="step">札記</div>
<div class="start">{{ created }}</div>
</div>
<div class="timeline-info" >
<div class="textBK">
<div class="text">
<h5>{{ commentTitle }}</h5>
<p>{{ commentContent }}</p>