Skip to content

Instantly share code, notes, and snippets.

View tiffany352's full-sized avatar

Tiffany Bennett tiffany352

View GitHub Profile
/* Title: std.ssl
Binds GnuTLS for easy interface with std.socket */
module std.ssl;
import std.string, c.unistd, c.sys.socket, c.netdb, c.string, c.errno, c.gnutls.gnutls, std.socket;
pragma(lib,"gnutls");
enum AuthType {
Client,
function getCost(A,B)
return (A-B).magnitude();
end
while true
local point = getPosition();
local points = {
point+vec2i( 1, 0),
point+vec2i( 0, 1),
point+vec2i( 1, 1),
[tiffany@localhost scripts]$ fcc -O -release primes.nt
[tiffany@localhost scripts]$ time -p ./primes
real 3.47
user 3.46
sys 0.00
[tiffany@localhost scripts]$ time -p luajit -O3 primes.lua
real 3.78
user 3.77
sys 0.00
[tiffany@localhost scripts]$ gcc -std=c99 -o primes-c primes.c
@tiffany352
tiffany352 / bbs.lua
Created December 14, 2012 22:19
My ComputerCraft BBS cilent/server
ARGS = {...}
COLORCTL = string.char(3)
HOMESCREEN = {
screen = "hello, world!",
click = function(x,y) end,
line = function(str) end
}
function log(chan, msg)
[tiffany@arch scripts]$ gcc -shared luajit_test.c -o libluajit_test.so
[tiffany@arch scripts]$ export LD_LIBRARY_PATH=.
[tiffany@arch scripts]$ luajit luajit_test.lua
hello, world
0
@tiffany352
tiffany352 / fun.lua
Last active December 14, 2015 09:39
Typeclasses in lua
local fun = {}
--[[
fun.lua, tiffany's typeclass implementation in lua
Copyright (c) 2013 tiffany <tiffany@stormbit.net>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
[tiffany@localhost ycm_build]$ make
[ 75%] Built target BoostParts
[ 87%] Built target ycm_core
[ 88%] Building CXX object ycm/tests/gmock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o
In file included from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h:74:0,
from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/include/gmock/internal/gmock-port.h:45,
from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/include/gmock/internal/gmock-generated-internal-utils.h:44,
from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/include/gmock/internal/gmock-internal-utils.h:45,
from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/include/gmock/gmock-actions.h:46,
from /home/tiffany/.vim/bundle/YouCompleteMe/cpp/ycm/tests/gmock/include/gmock/gmock.h:58,
@tiffany352
tiffany352 / Asset streaming.md
Last active December 18, 2015 21:19
IntenseLogic Ideas

Asset streaming would require placeholder assets, as well as an ability to reload assets as needed. The placeholder would be returned, and then the real asset would be downloaded in the background. Once the asset has completed downloading, it would be refreshed, returning the real asset.

@tiffany352
tiffany352 / Example Shader
Created July 28, 2013 03:24
An example of how IL's conditional shader compilation system could work.
#version 1
required-version: 140 // GLSL version
name: "Example Shader"
description: "A simple example shader, which shows how you could have conditional compilation based on whether or not texture coordinates are available."
#vertex-shader
#array-attrib position vec3 in_Position
#if drawable.texcoord
#array-attrib texcoord vec2 in_Texcoord
out vec2 texcoord;
@tiffany352
tiffany352 / calc.rs
Created August 8, 2013 21:56
My first non-hello rust program
use std::os;
enum Token {
Add,
Sub,
Mul,
Div,
Mod,
Func {name: ~str, args: ~[~str]},
Num (int),