Skip to content

Instantly share code, notes, and snippets.

View AleksLitynski's full-sized avatar

Aleksander Litynski AleksLitynski

View GitHub Profile
// prints the tag tree 'self' into an sds string 'printed'
// recursive function, 'node_addr' should start at 0
sds _ts_tags_print_node(ts_tags * self, size_t node_addr, sds padding, sds printed) {
/*
return value should resemble this structure:
.
|── 0
│ |── abc123
| +── abc124
var aList = ["a", "b", "c"];
var bObj = {};
for(var i in aList) {
bObj[i] = function() {
console.log(i);
}
}
-module(hello).
-export([hello/0]).
hello() ->
print2()("hello").
print(output) ->
io:format("~s~n", [output]).
//A list of effects to be applied to a value
List<Func<double,double>> effects = new List<Func<double,double>>();
//Two sample anonymous effects.
effects.Add(initial_value => initial_value / 2);
effects.Add(initial_value => initial_value - 1);
//Storing an effect as a function, then applying it.
Func<double,double> fire_effect = x => x*x;
effects.Add(effect);
@AleksLitynski
AleksLitynski / gist:9592212
Created March 17, 2014 01:06
notifications only show via file, not http
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<script>
function show_notification(){
//http://www.w3.org/TR/notifications/
//tags are for shared notes. If gmail is open twice, they cannot know
@AleksLitynski
AleksLitynski / Teller.md
Last active August 29, 2015 13:55
Notes on a game I'm calling Teller. They're still pretty disjointed.

Teller (A storytelling game)

(Exciting news: I have a $1000 grant for this project!!)

The Big Ideas

  • a single story can be grafted onto any group of characters. The dev writes a story once, but can apply it to multiple situations.

The player is exploring an open world. A fantasy world. They come across a "detective story". They are asked to find the missing puppy. Later, they're playing a space adventure, and the same detictive story appears, this time with different trappings. Space-dogs. Robo-damsels. Etc.

@AleksLitynski
AleksLitynski / worst c# ever
Created July 25, 2013 21:58
ability system
abstract class ability
{
string name;
string description;
ability(n, d)
{
name = n; description = d;
}
@AleksLitynski
AleksLitynski / Rust file IO attempt
Last active December 20, 2015 05:09
file IO error
let file_read: Result<@Reader, ~str> = std::io::file_reader(~std::path::Path("handw.rc"));
let file_text:~[~str] = match file_read {
Ok(file) => return file.read_lines(),
Err(e) => {
println(fmt!("Error reading file: %?", e));
return ~[];
}
};