Skip to content

Instantly share code, notes, and snippets.

View otiai10's full-sized avatar
👋

Hiromu OCHIAI otiai10

👋
View GitHub Profile
@otiai10
otiai10 / js
Created December 2, 2013 06:34
js
document.aform.selectedtext.value = document.getSelection();
Selection {type: "Range", extentOffset: 29, extentNode: text, baseOffset: 134, baseNode: text…}
document.aform.selectedtext.value
@otiai10
otiai10 / reply.md
Created December 3, 2013 03:07
返信

使って頂きありがとうございます。

2に関しましては、長時間同じウィジェットウィンドウを出し続けてると発生する問題として既知で、今の所これは仕様となっております。大変申し訳ございません。

1は調査の上修正したいと思います。もしよければ以下をご検討ください -ファイル名は「半角数字と半角英語」だけでしょうか? -設定の「スクショ撮るときにダウンロードもする」をオンにしたときも文字化けエラーが出ますか? -文字化けエラーが出た状態の画面をキャプチャして頂けると捗ります!

いずれにしても、大変ご不便おかけし申し訳ございません。お詫び申し上げます。

@otiai10
otiai10 / Grunt.js
Created December 3, 2013 10:29
Warning: Task "hoge" not found. Use --force to continue.
module.export = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
sample: {
cmd: 'ls -la'
}
}
});
grunt.loadNpmTasks('grunt-exec');
@otiai10
otiai10 / gist:7967541
Created December 15, 2013 01:30
スクショダウンロード時のChromeクラッシュ
Process: Google Chrome [7257]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 31.0.1650.63 (1650.63)
Code Type: X86 (Native)
Parent Process: launchd [152]
Responsible: Google Chrome [7257]
User ID: 501
Date/Time: 2013-12-15 10:19:45.696 +0900
@otiai10
otiai10 / gist:8019749
Created December 18, 2013 09:45
RPOMPT
## R-PROMPT ##
RPROMPT=$'%B%F%{\e[40;01m%}[%f%b`rprompt-git-current-branch` %~%B%F%{\e[40;01m%}]%f%b'
# {{{ lib for R-PROMPT #
# gitディレクトリの時はステータスによって色分けしてくれるところ
# ${fg[...]} や $reset_color をロード
autoload -U colors; colors
function rprompt-git-current-branch {
local name st color
if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
return
@otiai10
otiai10 / zshrc.sh
Last active January 8, 2019 01:08
zshのプロンプトにブランチ名とかステータスとか出すアレ
# ----- PROMPT -----
## PROMPT
PROMPT=$'[%*] → '
## RPROMPT
RPROMPT=$'`branch-status-check` %~' # %~はpwd
setopt prompt_subst #表示毎にPROMPTで設定されている文字列を評価する
# {{{ methods for RPROMPT
# fg[color]表記と$reset_colorを使いたい
# @see https://wiki.archlinux.org/index.php/zsh
@otiai10
otiai10 / resizer.py
Created December 19, 2013 08:07
Pythonで画像リサイズするときのアレ。PILペロペロ
from PIL import Image
import os
my_src_dir = 'src'
my_out_dir = 'out'
my_resize_rate = 1/2
def main():
resize_all(my_src_dir, my_out_dir)

Revelの紹介

早速、Revelの紹介から見ていきます

[http://robfig.github.io/revel/:title]

"Features"

  • Hot Code Reload
    • Edit, save, and refresh. Revel compiles your code and templates for you, so you don't miss a beat. Code doesn't compile? It gives you a helpful description. Run-time code panic? Revel has you covered.

    • 編集や保存、更新をすれば、Revelがコードやテンプレをコンパイルしてくれるので、コンパイル忘れすることはありません。コンパイル失敗したときは、良い感じのコンパイルエラーで説明してくれるはずです。ランタイムのpanicが出たときもサポートしてくれるでしょう。

  • Comprehensive

前回にひきつづき、Golangどころかフレームワークのなんたるかを理解していない僕はRevelのドキュメントを和訳しつつ、理解を深めたいでござる。

それでは

今回はOverviewからでござる。

Overview

This section gives you a taste of various parts of the framework: