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
# Swappable Mixins in CoffeeScript | |
# ================================ | |
# This is experimental. Not tested. It's just a toy, and I'm very new to | |
# javascript/coffeescript. Be warned. | |
# 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
-- Print contents of `tbl`, with indentation. | |
-- `indent` sets the initial level of indentation. | |
function tprint (tbl, indent) | |
if not indent then indent = 0 end | |
for k, v in pairs(tbl) do | |
formatting = string.rep(" ", indent) .. k .. ": " | |
if type(v) == "table" then | |
print(formatting) | |
tprint(v, indent+1) | |
else |
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
Mixin = {} | |
Mixin.__index = Mixin | |
Mixin.__mixins = {Mixin} | |
function Mixin:__index (method) | |
for i=#getmetatable(self).__mixins, 1, -1 do | |
local m = getmetatable(self).__mixins[i][method] | |
if m then return m end | |
end | |
end |
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
_=%(_=%();puts _.insert 4,_);puts _.insert 4,_ |
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
// The following code doesn't work on Mac OS X Lion | |
// (I don't know for other platforms): | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <GL/glfw.h> | |
char *VS = "#version 150\n in vec2 position; void main() {gl_Position = vec4(position, 0.0, 1.0);}"; |
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
// The following code doesn't work on Mac OS X Lion | |
// (I don't know for other platforms): | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <GL/glfw.h> | |
char *VS = "#version 150\n in vec2 position; void main() {gl_Position = vec4(position, 0.0, 1.0);}"; |
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
;set z, 0x9010 | |
set z, 0x8000 | |
:loop | |
jsr raw_key | |
ife x, 0 | |
set pc, loop | |
ife x, 0x8 | |
set pc, onkey_del | |
jsr code2ascii | |
set [z], x |
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
#!/usr/bin/env ruby | |
require 'ap' | |
RUNTIME = " | |
rem: | |
add $8, %rdi | |
ret | |
dup: |
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
program main -> X is | |
0x08 fibonacci | |
end | |
-- Renvoie (R) le Nieme element de la suite de fibonacci. | |
-- PRECONDITION: N >= 0 | |
program N fibonacci -> R is | |
take N 0x00 0x01 restore N |
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
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
OlderNewer