This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Call PrintTable on a table to print a nicely formated lua table to the console. | |
-- The print table can also be overloaded with a different type of printer to output the table in a new representation | |
-- like a blob. | |
-- | |
-- In the final version both these should be changed to local | |
TabSize = 4 | |
DataType = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
enum eStat | |
{ | |
HPNow, | |
HPMax, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
glyphs = [ | |
[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], // padding | |
[0, 0, 0, 0, 0, 0, 0, 0], // , 32 | |
[8, 8, 8, 8, 8, 0, 8, 0], // !, 33 | |
[20, 20, 20, 0, 0, 0, 0, 0], // ", 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
function isBitOn(number, index) { | |
return Boolean(number & (1 << index)); | |
} | |
window.onload = function() { | |
var canvas = document.getElementById('canvas'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias night="pmset displaysleepnow && osascript -e \"set volume output volume 34\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stats = {} | |
Stats.__index = Stats | |
function Stats:Create(stats) | |
local this = | |
{ | |
mBase = {}, | |
mModifiers = {} | |
} | |
-- Shallow copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nextLevel(level) | |
local exponent = 1.5 | |
local baseXP = 1000 | |
return math.floor(baseXP * (level ^ exponent)) | |
end | |
Stats = {} | |
Stats.__index = Stats | |
function Stats:Create(stats) | |
local this = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Reverses an ipairs table | |
-- | |
--local r = ReverseTable({'a', 'b', 'c'}) | |
--for k, v in ipairs(r) do | |
-- print(k, v) | |
--end | |
-- | |
-- | |
function ReverseTable(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Watch = {} | |
Watch.__index = Watch | |
function Watch:Create() | |
local this = | |
{ | |
key = {}, | |
keyRoot = | |
{ | |
id = "_G", | |
cursor = 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
class MainClass { | |
public static void PrintList<T>(List<T> l) | |
{ | |
for (int i = l.Count - 1; i >= 0 ; i--) |
NewerOlder