Skip to content

Instantly share code, notes, and snippets.

View minodisk's full-sized avatar

Daisuke Mino minodisk

  • Knowledge Work
  • Tokyo, Japan
  • 18:06 (UTC +09:00)
  • X @minodisk
View GitHub Profile
@minodisk
minodisk / .htaccess
Last active December 22, 2015 08:49
CRUDなアプリケーションの簡易ルーティング
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
@minodisk
minodisk / deferred.coffee
Last active December 19, 2015 08:39
$.whenのまずい設計をラップ
do ->
$.extend
parallel: (ds) ->
d = new $.Deferred
$.when.apply($, ds)
.done if ds.length <= 1
(results...) -> d.resolve [ results ]
else
@minodisk
minodisk / default
Created May 11, 2013 05:43
nginx on Mac
server {
listen 80;
server_name _;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
@minodisk
minodisk / Class.ts
Created March 26, 2013 05:12
onや_onから始まるとthisで束縛するクラス
class Class {
constructor() {
var ctor:any = (<any>this).constructor;
if (ctor.__on__ == null) {
ctor.__on__ = {};
for (var m in this) {
var fn:any = this[m];
if (typeof fn === 'function' &&
(m.indexOf('on') === 0 || m.indexOf('_on') === 0)) {
.DS_Store
Thumbs.db
.idea/
*.iml
@minodisk
minodisk / fixpng.coffee
Created July 24, 2012 08:46
DD_belatedPNG でエレメント渡してvml化するやつ
DD_belatedPNG?.fixPng imgElem
@minodisk
minodisk / getMousePoint.coffee
Created July 14, 2012 08:00
get mouse position from TouchEvent and MouseEvent
getMousePoint: (e)->
e = e.touches?[0] or e
x: e.pageX
y: e.pageY
@minodisk
minodisk / capture.as
Created June 27, 2012 09:56
自分撮りコンテンツのカメラの設定
var bmd:BitmapData = new BitmapData(video.width, video.height, true, 0);
bmd.draw(video, video.transform.matrix);
@minodisk
minodisk / autoslide_and_swipe.coffee
Created June 7, 2012 08:38
autoslide and swipe
$scroller = $('#scroller')
$children = $scroller.find('*')
childWidth = $($children[0]).width()
numChildren = $children.length
scrollerWidth = childWidth * numChildren
#autoslide
fixPos = (delta)->
left = parseFloat($scroller.css('left'))
if delta > 0 and left <= -scrollerWidth
@minodisk
minodisk / link.as
Created June 6, 2012 03:15
ASer should implement link like this