Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* php.ini
* phar.readonly=0
*
*
* /path/to/dir
* buildphar.php
* /src
package main
import (
"fmt"
"reflect"
"unsafe"
)
func Put(p unsafe.Pointer, key interface{}, value interface{}) {
mapType := reflect.MapOf(reflect.TypeOf(key), reflect.TypeOf(value))
@kmtr
kmtr / server.js
Last active August 29, 2015 14:15
var server = null;
var port = 3000;
var mbedUrl = 'http://192.168.100.44';
function redirect(req, res, oncomplete){
console.log(req);
var path = req._path + '?' + req._queryString;
var req = new XMLHttpRequest();
req.open('GET', mbedUrl + path, true);
try {
@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: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>
import webpack from "webpack";
import glob from "glob";
import path from "path";
let vendorModules = /(node_modules)/;
let entryFiles = glob.sync("./src/**/*.js");
let entries = {};
for (let f of entryFiles) {
let tmp = f.split("/");
@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>