Skip to content

Instantly share code, notes, and snippets.

@ukyo
ukyo / sample.html
Last active August 29, 2015 14:00
zerofill for angular filter
<div>{{hoge | zerofill:2}}</div>
@ukyo
ukyo / radio-group.html
Created May 10, 2014 13:55
これな気がしてきた
<radio-group name="fruit" ng-model="fruit">
<radio ng-value="1">apple</radio>
<radio ng-value="2">banana</radio>
</radio-group>
class AngularBase
@inject = (args) ->
@$inject = args
#アノテーションに見えなくもない
class FooController extends AngularBase
@inject '$scope', '$http'
constructor: ($scope, $http) ->
# ...
@ukyo
ukyo / example.php
Created June 10, 2014 09:52
添付メール送る奴 php 5.1.6で動作確認
<?php
require "path/to/mail.php";
echo send_mail("[email protected]", "[email protected]", "subject", "message", "path/to/file.format");
@ukyo
ukyo / uirouter.coffee
Created August 6, 2014 03:38
ui routerの書き方、模索中
# stateごとに管理すればイイんじゃ無いか説
# 再利用可能だとおもったらdirective使う
angular.module 'foo'
.config ($stateProvider) ->
$stateProvider.state 'home',
url: '/'
template: """
<div>
<div>{{user.name}} {{user.email}}</div>
@ukyo
ukyo / 20150801win10.js
Last active December 7, 2015 11:11
unzip win10 edge vmware vm with node
var fs = require('fs');
var zlib = require('zlib');
var start;
var end;
function unzipFile(name, start, end) {
var rs = fs.createReadStream('MsEdge.Win10.VMware.zip', {start: start, end: end});
var inflateStream = zlib.createInflateRaw();
var ws = fs.createWriteStream(name);
@ukyo
ukyo / .gitignore
Last active December 18, 2018 03:39
ServiceWorker sample fetch with LZ4+MessagePack
node_modules/
@ukyo
ukyo / README.md
Last active March 20, 2016 19:08
emscriptenでwabassembly試す
@ukyo
ukyo / bench.js
Last active May 17, 2016 07:31
quick sort with wasm
// see http://indiegamr.com/generate-repeatable-random-numbers-in-js/
// the initial seed
Math.seed = 6;
// in order to work 'Math.seed' must NOT be undefined,
// so in any case, you HAVE to provide a Math.seed
Math.seededRandom = function(max, min) {
max = max || 1;
min = min || 0;
(module
(memory 1 1)
(func (export "test1")
(local $i i32)
i32.const 1000000000
set_local $i
loop
i32.const 0
i64.const 1