Skip to content

Instantly share code, notes, and snippets.

[
{
"type": "AssignExprNode",
"varName": "$monthDays",
"arrayIndex": {
"type": "IntNode",
"value": "1"
},
"expr": {
"type": "IntNode",
@qoh
qoh / test.cs
Last active April 16, 2016 14:10
function GuiBitmapCtrl::resizeToImage(%this)
{
if (!%this.isAwake())
{
error("GuiBitmapCtrl::resizeToImage can only be called on visible controls.");
return "";
}
%this.extent = "0 0";
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>LaTeX Editor</title>
<style>
* {
box-sizing: border-box;
}
local ffi = require "ffi"
ffi.cdef [[
bool QueryPerformanceFrequency(int64_t *lpFrequency);
bool QueryPerformanceCounter(int64_t *lpPerformanceCount);
]]
local ptr_freq = ffi.new("int64_t[1]")
local ptr_tick = ffi.new("int64_t[1]")
@qoh
qoh / index.html
Created March 28, 2016 16:04
Key Inspector
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Key Inspector</title>
<style>
body {
margin: 64px;
}
// Copyright (c) 2014, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
$CSS_DIRECTION_INHERIT = "inherit";
$CSS_DIRECTION_LTR = "ltr";
$CSS_DIRECTION_RTL = "rtl";
local schedule = ts.func "schedule"
if _G._TIMER_COUNT == nil then _G._TIMER_COUNT = 0 end
if _G._TIMER_TABLE == nil then _G._TIMER_TABLE = {} end
function _G._TIMER_FINISH(i)
i = tonumber(i)
_G._TIMER_TABLE[i]()
_G._TIMER_TABLE[i] = nil
end
@qoh
qoh / wave.lua
Last active March 11, 2016 21:01
--initialize
local timer = require "lua.timer"
local setColorFX = ts.func("FxDTSBrick", "setColorFX")
local fakeKillBrick = ts.func("FxDTSBrick", "fakeKillBrick")
local setColor = ts.func("FxDTSBrick", "setColor")
local group = SimSet("BrickGroup_46342")
local width, height = 64, 128
local grid = {}
local setColor = ts.func("FxDTSBrick", "setColor")
local group = SimSet("BrickGroup_46342")
local width, height = 128, 128
local grid = {}
for x = 1, width do
grid[x] = {}
for y = 1, height do
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
#canvas {
background-color: black;
}
</style>
</head>