Skip to content

Instantly share code, notes, and snippets.

@grapswiz
grapswiz / Fuga.coffee
Created December 11, 2012 02:21
src/main/coffee/info/graps/hoge/model/Fuga.coffee
“use strict”
Model = exports? and exports or @Model = {}
class Model.Fuga
constructor: ->
(゜o゜;
@grapswiz
grapswiz / LoginController.java
Created November 27, 2012 06:32
ログインページに飛んでほしい
package info.graps.controller;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;
public class LoginController extends Controller {
package info.graps.controller;
import info.graps.meta.dto.AuthMeta;
import info.graps.model.dto.Auth;
import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
@grapswiz
grapswiz / grunt.js
Created November 1, 2012 11:20
わかめさん用
/*
* grunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
module.exports = function (grunt) {
@grapswiz
grapswiz / index.html
Created October 8, 2012 01:26
エラーメッセージをサーバに送るやつ。firefoxだと期待通り動く。
<!DOCTYPE HTML>
<html lang="ja-JP">
<head>
<meta charset="UTF-8">
<title>CORS POST Example</title>
<script type="text/javascript" src="post.js"></script>
</head>
<body>
</body>
@grapswiz
grapswiz / gist:3838684
Created October 5, 2012 08:05
エラーが出たら通知してくれるやつ
window.onerror = function(message, url, line) {
// ここにメールを送る処理を書く
alert("message: " + message + " url: " + url + " line: " + line);
};
var hoge = {};
hoge.push(1);
@grapswiz
grapswiz / gist:3832726
Created October 4, 2012 10:14
objectにpushする(動かしてないからエラーでる)
Object.prototype.push = function(value) {
this[""+value] = value
}
var obj = {}
obj.push(word); // -> obj = { word: word }
@grapswiz
grapswiz / gist:3712798
Created September 13, 2012 08:09
router的なの
class Router
def: null
constructor: ->
@def = {}
route: =>
#pageloadとhashchangeに登録する
$(window).hashchange =>
@def[location.hash]?()
$ ->
@def[location.hash]?()
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/Users/grapswiz/.zshrc'
autoload -Uz compinit