This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ngx.req.get_method() ~= "POST" then | |
ngx.exit(ngx.HTTP_NOT_ALLOWED) | |
end | |
local cjson = require "cjson" | |
local lfs = require "lfs" | |
-- list of strings to replace (the order is important to avoid conflicts) | |
ngx.req.read_body() |
#現在位置から天気予報を取って糧にする
技術的な文章を書いていなかったので気まぐれに。
今更感甚だしいけど最近のブラウザでは GPS が取得できる。
やり方はいくつかあるけど自分の中では以下に落ち着いた。
watchID = nav.geolocation.watchPosition (pos)=>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Config = require '../Config' | |
lib = Config.getLibPath() #path.relative とか process.cwd() とか駆使して動的にモジュールの場所を解決してくれるメソッドを頑張って作って下さい。 | |
libA = require lib + '/libA' | |
libB = require lib + '/libB' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require 'express' | |
fs = require 'fs' | |
path = require 'path' | |
gulp = require 'gulp' | |
configure = require "../../apimock/configure" | |
app = express() | |
configure app, {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###* | |
フレーム更新時に呼ばれる | |
@method updateHandler | |
### | |
updateHandler =()-> | |
console.log "some animate code..." | |
raf updateHandler | |
return | |
###* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
"pantsu", | |
"fusafusa" | |
],( | |
Pantsu | |
Hage | |
)-> | |
class Kuso extends Hage | |
constructor:(foo, bar, over=false)-> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AritcleModel extends ORMModel | |
kls : AritcleModel | |
#どっちがいいかなー | |
#こっちと | |
table : [ | |
"id" : "int" | |
"title" : "string" | |
"body" : "string" | |
"more" : "string" | |
"created_at" : "date" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseHoge | |
@foo:()-> | |
console.log "bar" | |
@extends:(kls)-> | |
props = [] | |
o = @ | |
while o | |
props = props.concat Object.getOwnPropertyNames o | |
o = Object.getPrototypeOf o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- ogp をページごとに変えたい場合に使う。 | |
mixin ogp(ogpData) | |
// ogp tags | |
meta(property="og:title", content="#{ogpData.title}") | |
//- トップページはwebsite、個別ページはarticle | |
meta(property="og:type", content="article") | |
//- 記事の説明 | |
meta(property="og:description", content="#{ogpData.description}") | |
//- 記事の URL | |
meta(property="og:url", content="#{ogpData.url}") |
NewerOlder