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
#!/bin/sh | |
BACKERS=data/core/backers.json | |
BACKUP=data/core/backers.bak.json | |
if [ ! -f "$BACKUP" ] | |
then | |
echo "Backing up backers.json.." | |
mv "$BACKERS" "$BACKUP" | |
fi | |
echo "Replacing backers.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
module trainsearch; | |
void main() { | |
int[][] paths; | |
// There are only six paths through the | |
// intersection that a train can take. | |
/* | |
paths ~= [2]; | |
paths ~= [3]; | |
paths ~= [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
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.numeric_std.all; | |
library altera; | |
use altera.altera_syn_attributes.all; | |
entity Counter is | |
generic (Size:Integer); | |
port ( | |
Step, Reset: in std_logic; |
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
[snip] | |
.text | |
.globl module_test7_add_of_function_to_sys_int_of_sys_int_and_sys_int | |
.type module_test7_add_of_function_to_sys_int_of_sys_int_and_sys_int, @function | |
module_test7_add_of_function_to_sys_int_of_sys_int_and_sys_int: | |
pushl %ebp | |
movl %esp, %ebp #mov4.2 | |
.L106_entry: | |
pushl $0 | |
movl 12(%esp), %eax #mov4.2 |
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
void sendPlayerPosLook(double x, y, z, float yaw, pitch, bool onGround) { | |
byte[auto~] data; | |
data ~= toField &x; | |
data ~= toField double:(y + 2); | |
data ~= toField &y; | |
data ~= toField &z; | |
data ~= toField &yaw; | |
data ~= toField &pitch; | |
data ~= *byte*:&onGround; | |
sendPacket(0x0d, data[]); |
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
module tetris; | |
import sdl; // For graphics output | |
import std.math, std.file, std.random; | |
extern(C) int time(int*); | |
// Board size. size[0] is x is horizontal. size[1] is y is vertical. | |
alias size = (7, 14); |
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
module pyramid; | |
import opengl, glsetup; | |
import sdl, camera; | |
import std.macros.switchover; | |
void main(string[] args) { | |
// resizeWindow (640, 480); | |
auto vertices = [vec3f (-1, -1, -1), vec3f(1, 1, 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
auto once-per(float t) { | |
auto lastrun = sec(); | |
return new \(void delegate() task) { | |
auto sec = sec(); | |
if (sec - lastrun > t) { | |
lastrun = sec; | |
task(); | |
} | |
} |
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
class Text : RectWidget, HasSizeInfo { | |
[...] | |
void setText(string s) { | |
provide "recomputes width"; | |
[...] | |
class LinebreakText : RectWidget, HasSizeInfo { | |
[...] | |
void make-layout() { |
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
auto mksphere(int depth) { | |
alias V = vec3f; | |
(V,V,V)[auto~] res; | |
if false return res[]; // return type hint | |
if (!depth) { | |
auto points = [for tup <- cross([-1, 1] x 3): V tup].eval[]; | |
for auto tup <- [ | |
(0, 1, 3), (0, 3, 2), | |
(4, 5, 7), (4, 7, 6), |
OlderNewer