#Heroku導入メモ
→ Heroku | Cloud Application Platform
- 知っておきたい!Herokuを使う上では当たり前?の16の常識 | blog.mah-lab.com
- デザイナーもHerokuを使ってみよう!Herokuを使って静的ページを無料で作る - KUROIGAMEN(黒い画面)
##Herokuとは?
/* | |
* Copyright (c) 2013 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
#!/bin/bash | |
# Convert Markdown to Wordpress blogging format | |
# Required program(s) | |
req_progs=(ascii2uni pandoc) | |
for p in ${req_progs[@]}; do | |
hash "$p" 2>&- || \ | |
{ echo >&2 " Required program \"$p\" not installed."; exit 1; } | |
done |
sys.path += ["."] | |
extensions += ["markdown"] | |
markdown_title = 'hello world' | |
source_suffix = '.md' |
Mocking - not testing - private functions in JavaScript
Instead of trying to extract a private function, we can rely on mocking/spying. This gist shows how to use the "new Function()" constructor to replace an internal call so that we can mock, spy or stub.
Another response to @philwalton -
http://philipwalton.com/articles/how-to-unit-test-private-functions-in-javascript/
This is a followup to https://gist.github.com/dfkaye/5971486 - a suggestion for
*annotating* functions to be extracted and tested separately (publicly).
curl -XPUT 'http://localhost:9200/us/user/1?pretty=1' -d ' | |
{ | |
"email" : "john@smith.com", | |
"name" : "John Smith", | |
"username" : "@john" | |
} | |
' | |
curl -XPUT 'http://localhost:9200/gb/user/2?pretty=1' -d ' | |
{ |
# based on: http://stackoverflow.com/questions/1015307/python-bind-an-unbound-method#comment8431145_1015405 | |
def bind(instance, func, as_name): | |
""" Turn a function to a bound method on an instance | |
.. doctest:: | |
>>> class Foo(object): | |
... def __init__(self, x, y): | |
... self.x = x | |
... self.y = y |
エディタの方。個人的結論としては「かなり良いけど乗り換えるならもう少し(1.0くらいまで)待ってからでもいいんじゃないか」という感じになると思う。
公式ドキュメントが整備された記念にgistの試し書きも兼ねて書きなぐり。ちなみにこれ自体もAtom で Gist It とか Asciidoc Preview とか使って書いてる。
比較対象は Sublime Text 。 Brackets は特化型っぽいし Light Table はまだ実用的に感じない(Eve 含め少し気になってはいる)。宗教系はもう必要時以外は触れたくない。
@echo off | |
chcp 65001 >NUL | |
set JAVA_OPTS=-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Dfile.encoding=UTF-8 | |
cmd /c %USERPROFILE%\Downloads\redpen-cli-1.2\bin\redpen.bat ^ | |
-c %USERPROFILE%\Downloads\redpen-cli-1.2\conf\redpen-conf-ja.xml %* 2>&1 ^ | |
| findstr /V /R "^$" | findstr /V /C:"[INFO ]" | |
if ERRORLEVEL 1 ( | |
exit /b 0 | |
) else ( | |
exit /b 1 |
<redpen-conf lang="ja"> | |
<validators> | |
<!--Rules on sentence length--> | |
<validator name="SentenceLength"> | |
<property name="max_len" value="100"/> | |
</validator> | |
<validator name="CommaNumber" /> | |
<!--Rules on expressions--> | |
<validator name="ParagraphNumber"/> |