Skip to content

Instantly share code, notes, and snippets.

View shiwano's full-sized avatar
💭
😇

Shogo Iwano shiwano

💭
😇
View GitHub Profile
@shiwano
shiwano / misakura.rb
Last active August 29, 2015 13:57
misakura's formula for HomeBrew
require 'formula'
class Misakura < Formula
homepage 'https://github.com/shiwano/misakura'
url "https://github.com/shiwano/misakura/archive/v0.1.1.tar.gz"
sha1 "279035a33ca149815fab153222470c9621d7a7ee"
def install
bin.install "misakura"
end
@shiwano
shiwano / controller.coffee
Created March 11, 2014 14:10
Titanium サンプル
Globals = Alloy.Globals
SceneController = require 'common/controllers/scene'
class exports.Controller extends SceneController
name: Globals.Consts.Scenes.Start
events:
'click startButton': 'moveToHome'
'click optionButton': 'moveToOption'
initialize: ->
@shiwano
shiwano / imagemagick_memo.md
Last active August 29, 2015 13:56
imagemagick memo
  • convert image.png -crop 4x2@ +repage +adjoin image_%d.png
  • mogrify -transparent '#81797d' *.png
@shiwano
shiwano / weighted_random_choice.coffee
Last active August 29, 2015 13:56
weighted random choice
module.exports = class WeightedRandomChoice
constructor: (args) ->
@_weightPairs = _.sortBy _.pairs(args), (pair) -> pair[1]
@sum = _.reduce @_weightPairs, ((memo, pair) -> memo + pair[1]), 0
check: (num, weight) -> num - weight <= 0
random: -> _.random 1, @sum
select: ->
num = @random()
Process: MacVim [3688]
Path: /Applications/MacVim.app/Contents/MacOS/MacVim
Identifier: org.vim.MacVim
Version: 7.4 (20131023)
Code Type: X86-64 (Native)
Parent Process: launchd [252]
Date/Time: 2013-10-24 12:29:34.989 +0900
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9
javascript:(function(){document.styleSheets[1].addRule('#cookieShower','background-image:url("https://dl.dropboxusercontent.com/u/34494006/cookie_clicker/cookieShower3.png") !important');document.styleSheets[1].addRule('#bigCookie','background-image:url("https://dl.dropboxusercontent.com/u/34494006/cookie_clicker/nakachan.png")');document.styleSheets[1].addRule('.cookieParticle','background-image:url("https://dl.dropboxusercontent.com/u/34494006/cookie_clicker/small_steels.png")');})();
@shiwano
shiwano / vim_centos.sh
Last active December 16, 2015 17:19 — forked from fundon/vim_centos.sh
#!/bin/bash
# on centos minimal
yum install gcc
yum install make
yum install ncurses-devel
yum install lua lua-devel
yum install ruby ruby-devel
yum install python python-devel
@shiwano
shiwano / vimgirl.txt
Last active April 25, 2017 06:55
Vim Girl の AA。 等幅。M+フォントかM+フォント合成フォントでの閲覧推奨。
メ __-─-,-- _
,イ >:::::::::::< ヽ〟
ヽ─イ /,::::,::::::::\ >─r
ヾ〟//:!:::ハ::::::|:!:ヽ ,丿
ソ r:リヤ ハ::::::ハ:ハ::|rヘ〟
Ⅲ:|:| V―ヘ::::/-ル゙|/ ハリ\ あらぶる
!|:ハ:|,-=〟ヽ/,-=.ソハリ H Vim の
!ヽriゾUソゾ "ハUソノ゙hNノソ ぽーず♡
|!ハヾヾ` `´ノlリ´
ノ:ノハ ハ 丶 クハ ____
(function () {
function sleep(time) {
var d1 = new Date().getTime();
var d2 = new Date().getTime();
while(d2 < d1 + time) {
d2 = new Date().getTime();
}
return;
}
@shiwano
shiwano / animation_sprite_generator.jsx
Created September 11, 2012 11:52
Generate a sprite from animation frames
/*
<javascriptresource>
<name>Generate a sprite from animation frames</name>
<category>web</category>
</javascriptresource>
*/
var AnimationSpriteGenerator, console, main, showInputSizeDialog;
console = {