Skip to content

Instantly share code, notes, and snippets.

View tosik's full-sized avatar
🏠
Working from home

Toshiyuki Hirooka tosik

🏠
Working from home
  • Tokyo, Japan
View GitHub Profile
@tosik
tosik / Gruntfile.coffee
Created July 26, 2013 07:51
rust run main.rs grunt task
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-exec'
grunt.initConfig
exec:
rustrun:
command: 'rust run main.rs'
grunt.registerTask 'default', ['exec:rustrun']
@tosik
tosik / terminal.sh
Last active December 20, 2015 08:39
why does elixir output the warning 'variable x is unused' ?
% elixir main.exs
> unused_x_variableain.exs:4: variable x is unused
> foo
@tosik
tosik / object-to-int-1.as
Created July 29, 2013 07:16
object や primitive と valueOf を絡めた AS3 のコンパイラとランタイムの挙動について
var object:* = new Object;
var foo:int = object;
trace(foo); //=> 0
@tosik
tosik / object-to-int.as
Created July 29, 2013 07:45
valueOf を使わずに Object が int に変換される例
package
{
import flash.display.Sprite;
public class Main extends Sprite
{
public function Main()
{
trace(int(new Foo).valueOf()); //=> 123
}
@tosik
tosik / main_context.coffee
Created September 7, 2013 04:01
こんな風に Context#commandMap で WHEN the event happened THEN execute this command が実現できるようにした
_module_ 'App.Main', ->
class @MainContext extends Base.Context
startup: ->
@commandMap.when(@startupDone).then(App.Main.SayHelloCommand)
shutdown: ->

Ant ビルドファイルのリファクタリング

ThoughtWorks アンソロジーの 10章 Ant ビルドファイルのリファクタリング p154 の項目抜き出し

  • macrodef の抽出
  • ターゲットの抽出
  • 宣言の導入
  • 依存による call の置き換え
  • filtersfile の導入
  • プロパティファイルの導入
# coding: utf-8
require 'cinch'
def unko
"💩"
end
def shit
unko
end
@tosik
tosik / file0.txt
Created February 25, 2014 04:00
Adobe AIR for iOS の Low memory warning による GC 大量発生を無視する方法 ref: http://qiita.com/tosik/items/9f9b474f03777626a42d
// AirLowMemoryWarningSuppressor.h
#import <UIKit/UIKit.h>
#import "FlashRuntimeExtensions.h"
@interface AirLowMemoryWarningSuppressor : NSObject <UIApplicationDelegate>
@end
// AirLowMemoryWarningSuppressor.m
@tosik
tosik / Bar.as
Created February 27, 2014 02:05
as3signals で ActionScript3 の Event をやめよう ref: http://qiita.com/tosik/items/2c1596abf3d43077fe6e
var button:Button = new Button();
button.clicked.add(function():void {
trace("The button clicked.");
});
@tosik
tosik / file0.txt
Created February 27, 2014 08:00
iOS で広告識別子 ASIdentifierManager.advertisingIdentifier を使っていないか調べる方法 ref: http://qiita.com/tosik/items/a98496c09c60c2d3925d
nm -u libThirdParty.a | grep ASIdentifierManager