Skip to content

Instantly share code, notes, and snippets.

View Quramy's full-sized avatar
👾

Yosuke Kurami Quramy

👾
View GitHub Profile
@Quramy
Quramy / fire-router.js
Last active July 6, 2016 02:15
falcor-fire
import _ from "lodash";
import Router from "falcor-router";
const routingDefinitions = [
{
// "users.u001.name" のようなpathに反応する
route: "[{keys:collections}][{keys:ids}][{keys:props}]",
get: function(pathset) {
const collectionName = pathset.collections[0];
const paths = pathset.ids.map(id => ({ refPath: `/${collectionName}/${id}`, fPath: [collectionName, id] }));
@Quramy
Quramy / inversifySample.ts
Created May 4, 2016 11:23
inversifyjs-demo
import 'reflect-metadata';
import {injectable, Kernel} from 'inversify';
// 注入したい振る舞いの定義
@injectable()
abstract class AwesomeService {
abstract greeting(): string;
}
// 振る舞いに対応した実装
function! vim_typings#install(...)
let type_file_list = map(range(1, a:{0}), 'a:{v:val}')
let stdouts = systemlist('typings install '.join(type_file_list, ' ').' --save')
if v:shell_error
let stdouts = systemlist('typings install '.join(type_file_list, ' ').' --ambient --save')
endif
echom join(stdouts, ', ')
endfunction
@Quramy
Quramy / tsconfig.json
Created April 10, 2016 04:38
ts config for ng2
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"sourceMap": false,
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
@Quramy
Quramy / ts-angular-boilerplate.sh
Created January 4, 2016 08:02
Angular2 TypeScript boilerplate
#!/bin/sh
APP_NAME=$1
[ -z "$APP_NAME" ] && echo "1 args required" && exit 1
[ -d "$APP_NAME" ] && echo "$APP_NAME exists" && exit 1
which tsc || npm install -g typescript
which browser-sync || npm install -g browser-sync
which watchify || npm install -g watchify
@Quramy
Quramy / index.js
Created September 3, 2015 11:19
request idle callback sample
'use strict';
var counter = (next, loopNum, wait) => {
var count = 0;
var last = Date.now();
var logger = () => {
wait && heavyFunction(wait);
console.log(next.name, Date.now() - last , count);
count++;
last = Date.now();
@Quramy
Quramy / navigateTo.js
Created April 25, 2015 06:02
A service snippet like $state.go with ngNewRouter
angular.module('yourApp').factory('navigateTo', function ($location, $router) {
return function (name) {
$location.url($router.generate(name));
};
});
@Quramy
Quramy / gist:0dea2d4ad42d2e9d7f15
Last active August 29, 2015 14:12
svg rect test01
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>レイヤ 1</title>
<rect id="svg_1" height="156" width="382.00001" y="52" x="99" stroke-width="5" stroke="#000000" fill="#FF0000"/>
</g>
</svg>
@Quramy
Quramy / gist:2585975
Created May 3, 2012 14:26
git remote add
git remote add heroku git@heroku.com:mennakumaker.git