Skip to content

Instantly share code, notes, and snippets.

View ngs's full-sized avatar
🎣
Fly Fishing

Atsushi NAGASE ngs

🎣
Fly Fishing
View GitHub Profile
@ngs
ngs / help.txt
Created November 10, 2010 12:23
Closure Compiler --help
--charset VAL : Input and output charset for all
files. By default, we accept UTF-8 as
input and output US_ASCII
--compilation_level [WHITESPACE_ONLY : Specifies the compilation level to
| SIMPLE_OPTIMIZATIONS | ADVANCED_OPTI : use. Options: WHITESPACE_ONLY,
MIZATIONS] : SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZ
ATIONS
--compute_phase_ordering : Runs the compile job many times, then
prints out the best phase ordering
from this run
@ngs
ngs / flashlog
Created November 11, 2010 18:18
Watch FlashDev trace log
#!/usr/bin/env perl -w
use strict;
use warnings;
use FileHandle;
use Getopt::Long;
my $file = $ENV{FLASH_LOG};
my $filter = undef;
GetOptions( 'filter|f=s' => \$filter );
jpegtopng() {
if [ ! -z "$1" ]; then
if [ -z "$2" ]; then
jpegtopnm $1 | pnmtopng > ${1%.*}.png
else
jpegtopnm $1 | pnmtopng > $2
fi
@ngs
ngs / README.md
Created November 27, 2010 20:59
Compile JavaScript files with Closure Compiler

structure

  • compile
  • lib
    • jquery.js
  • src
    • code-prefix.js
    • intro.js
    • module1.js
    • module2.js
  • ...
@ngs
ngs / ActiveRecordBase.java.patch
Created December 14, 2010 20:52
ActiveRecordBase.java patch
diff --git a/src/org/kroz/activerecord/ActiveRecordBase.java b/src/org/kroz/activerecord/ActiveRecordBase.java
index ebb2ddf..2e32b18 100644
--- a/src/org/kroz/activerecord/ActiveRecordBase.java
+++ b/src/org/kroz/activerecord/ActiveRecordBase.java
@@ -204,12 +204,10 @@ public class ActiveRecordBase {
* @return An array of fields for this class.
*/
protected List<Field> getColumnFieldsWithoutID() {
- Field[] fields = getClass().getDeclaredFields();
- List<Field> columns = new ArrayList<Field>();
@ngs
ngs / autopagerize-clear-cache.sh
Created January 14, 2011 18:19
Remove Safari extention - AutoPagerize's cache
#!/bin/sh
rm -f ~/Library/Safari/safari-extension_net.autopagerize.autppagerizeforsafari-*
rm -r ~/Library/Caches/com.apple.Safari/Extensions/AutoPagerize*.safariextension/siteinfo.json
@ngs
ngs / flickr.xsl
Created January 20, 2011 22:25
List Flickr photo using Apache cocoon
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:x="urn:flickr"
exclude-result-prefixes="s x">
<xsl:template match="/">
<html>
@ngs
ngs / rotate_devicefont_as2.as
Created January 21, 2011 02:03
デバイスフォントを90度回転
import flash.display.*;
import flash.geom.*;
var clip:MovieClip;
var clip2:MovieClip = createEmptyMovieClip("clip2", 0);
clip2._x = clip._x+100;
clip2._y = clip._y;
var bmp:BitmapData = new BitmapData(clip._width, clip._height);
clip2.attachBitmap(bmp,1);
bmp.draw(clip);
clip2._width = clip._width;
@ngs
ngs / Test.as
Created January 21, 2011 02:09
AS3: fl.motion.Animator についてメモ
package org.ngsdev.test {
import flash.display.Sprite;
import flash.display.MovieClip;
import fl.motion.Animator;
import fl.motion.MotionEvent;
class AnimatorTest extends Sprite {
var hoge_animator:Animator; //ここに宣言しないと動かない。
@ngs
ngs / Firegestures-GoogleReader.js
Created January 21, 2011 02:20
Firegestures-GoogleReader | LRのコマンドをカスタマイズ
const LR = "L"; //R
// Adapted from Google Reader Auto-Read
// http://userscripts.org/scripts/show/2035
function simulateClick(node) {
if(!node) return;
var event = node.ownerDocument.createEvent("MouseEvents");
event.initMouseEvent("click",
true, // can bubble
true, // cancellable