Skip to content

Instantly share code, notes, and snippets.

@kmtr
kmtr / gist:1373062
Created November 17, 2011 12:49
jquery.plugin.template.js
(function (jQuery) {
var value1 = 'default';
//('#hoge').myplugin({value1:'foo'})
jQuery.fn.myplugin = function (options) {
var options = jQuery.extend({
value1: value1
}, options);
value1 = options.value1;
this.each(
function () {
@kmtr
kmtr / gist:1380970
Last active July 18, 2019 21:42
smiley prompt($PS1)
(・ᴗ・):\w\n$
ʕ ◔ϖ◔ʔ:\w\n$
@kmtr
kmtr / gist:1380977
Created November 20, 2011 21:42
vim: C-a,C-e,C-f,C-b
map! <C-a> <Home>
map! <C-e> <End>
map! <C-f> <Right>
map! <C-b> <Left>
@kmtr
kmtr / index.html
Created May 5, 2012 07:31
Twitter Bootstrap Template
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link rel="shortcut icon" href="ico/favicon.ico">
</head>
# OpenPNE3/apps/pc_frontend/modules/community/config/module.ymlを見る限り、default_nav: <localNav type> で、
# そのmoduleで標準で使われるlocalNavのtypeを、nav: {<action>: <localNav type>} で、各action毎のlocalNavを
# 設定できるようになっていると期待されるが、実際にはdefault_navしか使われていない。
# 以下のようにコードを加えると、nav: {<action>: <localNav type>} も使用されるようになる。
--- OpenPNE3/apps/pc_frontend/modules/default/actions/components.class.php Thu May 31 19:53:52 2012
+++ OpenPNE3/apps/pc_frontend/modules/default/actions/components.class_fix.php Thu May 31 19:55:29 2012
@@ -30,6 +30,7 @@
$action = $context->getActionStack()->getLastEntry()->getActionName();
@kmtr
kmtr / beans.xml
Created September 3, 2012 21:12
JavaEE6 Jetty CDI(Weld)
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
@kmtr
kmtr / beans.xml
Created September 4, 2012 15:00
JavaEE6 Jetty CDI(Weld) JAX-RS(jersey)
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
@kmtr
kmtr / SpecRunner.html
Created May 2, 2013 11:53
mocha chai front runner
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Spec Runner</title>
<link rel="stylesheet" href="components/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="components/jquery/jquery.js"></script>
@kmtr
kmtr / handler.clj
Last active December 17, 2015 00:39
ring directoryindex middleware / -> /index.html /foo/ -> /foo/index.html /foo -> /foo
; clojure "1.5.1"
; compojure "1.1.5"
(ns app.handler
(:use compojure.core)
(:require [compojure.handler :as handler]
[compojure.route :as route]))
; middleware
(defn directoryindex [handler index]
(fn [request]
@kmtr
kmtr / Gruntfile.coffee
Last active December 17, 2015 03:08
Gruntfile.coffee jade, coffee, stylus
module.exports = (grunt)->
grunt.initConfig
jade:
compile:
files:[
expand: true
cwd: 'src/jade/'
src: '*.jade'
dest: 'build/'
ext: '.html']