Skip to content

Instantly share code, notes, and snippets.

View ifournight's full-sized avatar
👾
Alona!

Song Hui ifournight

👾
Alona!
View GitHub Profile
@ifournight
ifournight / getElementLeft
Created November 19, 2013 08:48
DOM DIMENSIONS
function getElementLeft(element) {
var actualLeft = element.offsetLeft;
var current = element.offsetParent;
while (current !== null) {
actualLeft += current.offsetLeft;
current = current.offsetParent;
}
return actualLeft;
import flash.geom.Matrix3D;
import flash.geom.Orientation3D;
import flash.geom.Vector3D;
public class Matrix3DUnils {
private static var _raw : Vector.<Number> = new Vector.<Number>(16, true);
private static var _toRad : Number = 0.0174532925199433;
private static var _toAng : Vector3D = 57.2957795130823;
private static var _vector : Vector3D = new Vector3D();
private static var _right : Vector3D = new Vector3D();
@ifournight
ifournight / csv
Created February 26, 2015 16:01
py
import csv
# Map row to dictionary (dictionary comprehension)
def player(column_names, row):
return {column_names[column]: data for column, data in enumerate(row) if column < len(column_names)}
# Map CSV file to list of dictionaries (list comprehension)
players = [player(['name', 'position', 'game_info', 'price'], row) for row in csv.reader(open('dk.csv', 'r'))]
def loadAvatarCsv(row):