This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
animator.coffee | |
(C) 2014 Shintaro Seki <s2pch.luck@gmail.com> | |
The MIT License | |
### | |
# | |
# Usage: | |
# fps = 15 | |
# animator = new Animator fps, (frameCount) -> | |
# console.log frameCount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vector2 | |
@fromArray: (a) -> new Vector2 a[0], a[1] | |
constructor: (x, y) -> @set x, y | |
set: (x, y) -> @[0] = x; @[1] = y; @x = x; @y = y; @ | |
clone: -> new Vector2 @x, @y | |
add: (v) -> @clone().iadd v | |
iadd: (v) -> @set @x+v.x, @y+v.y | |
sub: (v) -> @clone().isub v | |
isub: (v) -> @set @x-v.x, @y-v.y | |
muls: (s) -> @clone().imuls s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref: https://w3g.jp/blog/tools/js_browser_sniffing | |
UA = | |
ie: do -> | |
ie = false | |
ael = window.addEventListener? | |
ie = 6 if ael and not document.documentElement.style.maxHeight? | |
ie = 7 if not ie and ael and not document.querySelectorAll? | |
ie = 8 if not ie and ael and not document.getElementsByClassName? | |
ie = 9 if not ie and document.uniqueID and not window.matchMedia | |
ie = document.documentMode if not ie and document.uniqueID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Extentions | |
if has('vim_starting') | |
set nocompatible | |
set runtimepath+=~/.vim/bundle/neobundle.vim/ | |
endif | |
call neobundle#rc(expand('~/.vim/bundle')) | |
NeoBundleFetch 'Shougo/neobundle.vim' | |
" Bundle lists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MExtUtils::Installed -le 'print join "\n" => sort ExtUtils::Installed->new->modules;' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
convert $1 -geometry 40x40 Icon-40.png | |
convert $1 -geometry 80x80 Icon-40@2x.png | |
convert $1 -geometry 60x60 Icon-60.png | |
convert $1 -geometry 120x120 Icon-60@2x.png | |
convert $1 -geometry 72x72 Icon-72.png | |
convert $1 -geometry 144x144 Icon-72@2x.png | |
convert $1 -geometry 76x76 Icon-76.png | |
convert $1 -geometry 152x152 Icon-76@2x.png | |
convert $1 -geometry 50x50 Icon-Small-50.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://momijiame.tumblr.com/post/67058805910/vagrant-vm | |
# http://qiita.com/kakipo/items/57186721eaf6b83630ee | |
def create_disk(vb, name, size_gb, port) | |
file_path = "./tmp/#{name}.vdi" | |
unless File.exist?(file_path) | |
vb.customize ["createhd", | |
"--filename", file_path, "--size", size_gb * 1024] | |
vb.customize ["storageattach", :id, | |
"--storagectl", "SATA", "--port", port, "--device", 0, | |
"--type", "hdd", "--medium", file_path] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Cmdline; | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use Pod::Usage; | |
use Carp; | |
use parent qw(Exporter); | |
our @EXPORT = qw(cmdline); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Vue.js Test</title> | |
<style> | |
.btn { | |
background-color: #333; | |
color: #FFF; | |
border-radius: 3px; | |
cursor: pointer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/q/3454526 | |
function getNodeXPath(node, prefix) { | |
prefix = prefix ? prefix + ":" : ""; | |
var getNodeName = function(node) { | |
return { | |
1: prefix + node.nodeName.toLowerCase(), // instanceof Element | |
3: "text()" | |
}[node.nodeType]; | |
}; |
OlderNewer