Skip to content

Instantly share code, notes, and snippets.

@llamadonica
llamadonica / easing.dart
Created February 28, 2014 02:55
Gist function for easing.
class BezierPolynomial {
static _BezierGen generator = new _BezierGen();
static List<num> getTTerms(List<num> pTerms) {
var i = pTerms.length + 1;
var matrix = generator[i];
List<num> results = new List();
num linTerm = pTerms[0] - pTerms[0];
for (var j = 0; j < i - 1; j++) { //Get the nth term
num tTerm = pTerms[0] - pTerms[0];
for (var k = i; k > j && k > 1; k--) {
@llamadonica
llamadonica / gf_math.pl
Created December 4, 2012 01:20
Galois Field Reciprocal in PERL
#!/usr/bin/perl
$modulo = 0x1f9;
$order = msb($modulo);
sub gf_add {
return $_[0] ^ $_[1];
}
sub msb {
if ($_[0] == 0) { return -1;}
my $i = 0; $_ = $_[0];
while ($_ != 1) {
/*
* Copyright © 2010 Codethink Limited
* Copyright © 2011 Canonical Limited
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the licence, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@llamadonica
llamadonica / fileapi.html
Created January 11, 2013 06:56
Ideas for tiddlywiki plugin
<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Image preview example</title>
<script type="text/javascript">
var loadImageFile = (function () {
if (window.FileReader) {
var oPreviewImg = null, oFReader = new window.FileReader(),
@llamadonica
llamadonica / notes.txt
Last active December 22, 2015 07:39
Things that I need to handle specially for my reinstall:
agistudio
crayon-physics-deluxe
darwinia
google-talkplugin
no-dice
netflix-desktop
nautilus-dropbox
pomeranian
skype
spotify-client
void main() {
final test = new Test();
for (var func in doEverything()) {
func(test);
}
assert(test.foo == 'bar');
}
class Test {
String foo;
/*
* This example code is placed in the public domain
*
* Author: Owen Taylor <otaylor at redhat.com>, Red Hat Inc.
*/
#include <cairo-win32.h>
#define TITLE TEXT("Cairo test")