Consider this blog post model:
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
-- A function in Lua similar to PHP's print_r, from http://luanet.net/lua/function/print_r | |
function print_r ( t ) | |
local print_r_cache={} | |
local function sub_print_r(t,indent) | |
if (print_r_cache[tostring(t)]) then | |
print(indent.."*"..tostring(t)) | |
else | |
print_r_cache[tostring(t)]=true | |
if (type(t)=="table") then |
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
#ifdef VERTEX | |
attribute vec4 a_position; | |
attribute vec2 a_uv; | |
attribute vec3 a_normal; | |
attribute vec4 a_tangent; | |
uniform mat4 u_mvp; | |
uniform mat4 u_world2object; | |
uniform vec4 u_worldlightdir; | |
uniform vec4 u_worldcampos; |
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
/* | |
* Dependency : Excel Data Reader from http://exceldatareader.codeplex.com/ | |
* You must add the references to the Dlls (downloaded from the link above) with Visual Studio. | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Excel; |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |
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
require "try-catch" | |
try { | |
function() | |
error('oops') | |
end, | |
catch { | |
function(error) | |
print('caught error: ' .. error) |
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
import os | |
import urllib2 | |
import math | |
def downloadChunks(url): | |
"""Helper to download large files | |
the only arg is a url | |
this file will go to a temp directory | |
the file will also be downloaded | |
in chunks and print out how much remains |
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
--[[--- | |
Simple 3D benchmark based on samples/test/cube-3d. | |
- Video: http://www.youtube.com/watch?v=Fn54jJYw5y8&list=UUtHX3tIuYEScozlr4GqfF1Q | |
- Machine: macbook pro 2.53GHz i5, NVIDIA GeForce GT 330M 256 MB | |
- Benchmark spec | |
- num of props: 150 | |
- cube per prop : 8x8x8 = 512 | |
- total num of triangles: 12 x 512 x 150 = 921K | |
- frame rate: 60fps |
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
""" | |
This example requires the body-streaming tornado fork at https://github.com/nephics/tornado. | |
Refer to http://groups.google.com/group/python-tornado/browse_thread/thread/791c67cb86c2dea2. | |
Supports uploading an unlimited number/size of files in a single | |
PUT multipart/form-data request. Each file is processed as the stream | |
finds the part in the form data. | |
==USAGE== |
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
pcall(require,"socket") | |
local coroutine_scheduler = { | |
_NAME = "coroutine_scheduler.lua" | |
_VERSION = "1.0.0", | |
} | |
local Scheduler | |
do Scheduler = setmetatable({}, { | |
__call = function(class) |
OlderNewer