Skip to content

Instantly share code, notes, and snippets.

View alumican's full-sized avatar

Yukiya Okuda alumican

View GitHub Profile
@alumican
alumican / alumican.scss
Last active April 9, 2019 12:02
SASS tips
// ----------------------------------------
// Config
$image-directory: './image';
$bp-narrow-mobile : 320px;
$bp-mobile-tablet : 480px;
$bp-tablet-desktop: 800px;
@alumican
alumican / Timer.as
Created September 3, 2014 09:21
AS3 Timer based on getTimer
package util
{
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.TimerEvent;
import flash.utils.getTimer;
/**
* This is the timer class based on getTimer().
@alumican
alumican / main.py
Created May 15, 2014 17:10
ネーコンのねこツイート
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
import mechanize
from BeautifulSoup import BeautifulSoup
import tweepy
SHINDAN_URL = "http://shindanmaker.com/322469"
TWITTER_USERNAME = "username"
TWITTER_API_KEY = "*****************************"
@alumican
alumican / moja.pde
Created May 5, 2014 05:02
もじゃ
float offsetX;
float offsetY;
float endY;
float posX;
float posY;
float oldX;
float oldY;
float noise = 0;
void setup() {
@alumican
alumican / Recorder.as
Created February 13, 2014 09:42
指定したフレーム数だけステージをキャプチャしてデスクトップに保存する
// 1フレーム目に以下のスクリプトを記述する
// new Recorder(stage /*ステージ*/, 60 /*キャプチャしたいフレーム総数*/, "loading" /*プリフィックス*/);
package
{
import flash.desktop.NativeApplication;
import flash.display.BitmapData;
import flash.display.Stage;
import flash.events.Event;
import flash.filesystem.File;
@alumican
alumican / ZipLoader.as
Last active December 29, 2015 00:28
zipファイルをダウンロードしてメモリ上に非同期展開するクラス
/**
* zipファイルをダウンロードしてメモリ上に非同期展開する
*
* var loader:ZipLoader = new ZipLoader();
* loader.addEventListener(ZipLoaderEvent.COMPLETE, completeHandler);
* loader.addEventListener(ZipLoaderEvent.ERROR, errorHandler);
* loader.addEventListener(ZipLoaderEvent.EXECUTED, executedHandler);
* loader.load("http://path_to.zip");
*
* function completeHandler(event:ZipLoaderEvent):void {
@alumican
alumican / loading.as
Created November 17, 2013 06:20
クルクルローディングつくる君
/*
クルクルローディングつくる君
使い方
1. ライブラリにBarシンボルを作る(基準点を中心に回転する)
2. 以下のスクリプトを1フレーム目にコピペしてする
3. パラメータを適当に変える
4. 書き出し設定をAIRにしてムービープレビューする
5. デスクトップに保存されている
*/
@alumican
alumican / LeastList.as
Created April 26, 2013 03:53
登録したいずれかの処理が完了した場合に他のコマンドを中断する。 コマンドリスト どのコマンドが完了したかを知る場合、スマートな方法がわからないので個々のコマンド内でフラグを自力で管理する必要がある。
/**
* Progression 4
*
* @author Copyright (C) 2007-2010 taka:nium.jp, All Rights Reserved.
* @version 4.0.2
* @see http://progression.jp/
*
* Progression Libraries is dual licensed under the "Progression Library License" and "GPL".
* http://progression.jp/license
*/
@alumican
alumican / ReplaceFont.as
Last active December 11, 2015 17:19
FlashのTextField内の特定文字列を指定したフォントに置換するスクリプト
/**
* TextField内のアスキー文字列(半角英数記号)を指定のフォントに置換する
* @param field 操作対象のTextField
* @param font 置換後のフォント
*/
function replaceAsciiFont(tf:TextField, font:String):void
{
replaceFont(tf, /[\u0020-\u007e]+/g, font);
}
@alumican
alumican / StringUtil.find.as
Created January 25, 2013 09:59
文字列の中から指定した正規表現にマッチするものを見つける
function find(source:String, pattern:RegExp, callback:Function = null):Array {
var indices:Array = new Array();
var result:Object;
var i:int = -1;
while (result = pattern.exec(source)) {
++i;
if (callback != null) callback.call(null, i, result);
indices.push(result.index);
if (!pattern.global) break;
}