Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
ongaeshi / deg2rad.as
Created February 14, 2010 06:53
degreee、radianの相互変換(AS3)
package
{
/**
* ...
* @author
*/
public class Deg2Rad
{
static public function deg2rad(x:Number):Number
{
@ongaeshi
ongaeshi / trace2.as
Created February 14, 2010 10:46
配列、オブジェクト等をきちんとソースコードと同じ状態で表示してくれる, trace2, to_s
package
{
public class Lib {
static private function to_s_array(array:Object):String
{
var result:String = "";
result += "[";
for (var i:int = 0; i < array.length; i++) {
result += to_s(array[i]) ;
@ongaeshi
ongaeshi / FlexStyle.css
Created February 14, 2010 17:39
Flexのスタイルシートサンプル
Application {
backgroundColor: #CCCCCC;
backgroundAlpha: 1;
backgroundGradientColors: #CCCCCC, #CCCCCC;
backgroundGradientAlphas: 0, 0;
}
Button {
cornerRadius: 12;
paddingLeft: 3;
private function colorMul(color:uint, rate:Number):uint
{
var r:uint = (color >> 16) & 0xff;
var g:uint = (color >> 8) & 0xff;
var b:uint = (color >> 0) & 0xff;
r *= rate;
g *= rate;
b *= rate;
function deg2rad(x:Number):Number
{
return x * 0.0174532925;
}
function rad2deg(x:Number):Number
{
return x * 57.2957796;
}
@ongaeshi
ongaeshi / Vector2D.as
Created February 26, 2010 09:16
Vector2D
package com.foed
{
import flash.display.Graphics;
/**
* 基本的な2次元ベクトルクラス
*/
public class Vector2D
{
private var _x:Number;
@ongaeshi
ongaeshi / insert_time.js
Created March 24, 2010 11:58
TiddlyWikiにTwitterっぽいタイムスタンプを挿入するClipMenuのアクション
var date = new Date();
var month = date.getMonth() + 1;
if (month <= 9)
month = "0" + month;
var day = date.getDate();
if (day <= 9)
day = "0" + day;
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'rubygems'
require 'hpricot'
require 'optparse'
class Tiddle
attr_reader :title, :created, :modified, :tags, :changecount, :content
# -*- coding: utf-8 -*-
#
# @file
# @brief p_classtree 改良版
# @author ongaeshi
# @date 2010/09/30
# アルファベットと演算子で表示する数を変える
ALPHABET_DISP_NUM = 5
OPERATOR_DISP_NUM = 10
@ongaeshi
ongaeshi / gist:756364
Created December 27, 2010 18:03
Windowsでgroongaコンパイル時にエラー
i686-w64-mingw32-gcc は、cygwin付属のcygwin.dllに依存しないgcc4です。
% cd ~/work/rroonga/vendor/groonga-1.0.4
% ./configure CC='i686-w64-mingw32-gcc' CFLAGS='-g -O0 -mno-cygwin' prefix='/c/users/ongaeshi/work/rroonga/vendor/local' i386-pc-mingw32
% make
.
.
.
.
Making all in src