Skip to content

Instantly share code, notes, and snippets.

View rayyee's full-sized avatar
🌴
On vacation

Ray Yee rayyee

🌴
On vacation
View GitHub Profile
/**
*
*
* ScaleBitmap
*
* @author Didier Brun
* @author Jerôme Decoster
* @version 1.1
*
*/
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@hashmal
hashmal / gist:874792
Created March 17, 2011 17:54
[Lua] Print table contents recursively
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
@leegrey
leegrey / Vector2D.as
Created June 22, 2011 08:43
LGVector2D.as - A 2D Vector Class in AS3
//CLASS: com.lgrey.vectors.LGVector2D
//created by Lee Grey
package com.lgrey.vectors {
import flash.geom.Point;
public class LGVector2D {
public var x:Number = 0;
public var y:Number = 0;
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@mebens
mebens / gist:4218802
Created December 5, 2012 19:36
Simple glow/bloom GLSL shader for Love2D
// adapted from http://www.youtube.com/watch?v=qNM0k522R7o
extern vec2 size;
extern int samples = 5; // pixels per axis; higher = bigger glow, worse performance
extern float quality = 2.5; // lower = smaller glow, better quality
vec4 effect(vec4 colour, Image tex, vec2 tc, vec2 sc)
{
vec4 source = Texel(tex, tc);
vec4 sum = vec4(0);
package async
{
public class Deferred implements Promise
{
private const pending:Array = [];
private var processed:Boolean;
private var completed:Boolean;
@a-r-d
a-r-d / task_quick_sort.as
Last active December 11, 2015 07:49
AS3- using quick sort algorithm to sort on an arbitrarily specified attribute of a typed vector.
/**
* Some constants we use to choose sorting methods.
*/
public static const SORT_BY_DATE_START:String = "DATE_START";
public static const SORT_BY_ID_ASC:String = "ID_ASC";
/**
* Example function that calls the quick sort on a vector of some beans
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ggshily
ggshily / Understanding Flash Player with Adobe Scout
Last active December 11, 2015 20:29
[翻译]Understanding Flash Player with Adobe Scout
h1. 通过Adobe Scout深入理解Flash播放器
原文:[Understanding Flash Player with Adobe Scout|http://www.adobe.com/devnet/scout/articles/understanding-flashplayer-with-scout.html]
作者:[Mark Shepherd|http://www.adobe.com/devnet/author_bios/mark_shepherd.html]
作者:[Michael Smith|http://www.adobe.com/devnet/author_bios/michael-smith.html]
转载请注明出处
Adobe Scout 是优化Flash内容异常强大的工具,因为他可以让你看到在Flash播放器里场景背后真正发生了什么.但只有当你理解了Flash播放器为什么那么做的时候那些信息才是最有用的.也只有那时候你才能有效地解决Scout告诉你的问题.
这篇文章的目的是让你对Flash播放器如何工作有一个基础的理解,并且理解与此相关的在Scout里看到的信息.这也是Scout中用到的terminology的一个指南,因此你可以找到Flash播放器执行的不同的活动的意义.如果你用过Scout并且有"我发现我的程序花了很多时间在做X上,但我不知道X是什么意思"的疑问的话,这篇文章正适合你!
注意这不是一个使用Scout界面的指南.如果你不知道如何使用Scout,或者不同的面板干什么,那么你需要读一下[开始指南|http://www.adobe.com/devnet/scout/articles/adobe-scout-getting-started.html].