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
let boot (screen : Tcc.screen) : Framebuffer.framebuffer = | |
Framebuffer.init screen.width screen.height (fun _x _y -> 0) | |
let tick (t : int) (screen : Tcc.screen) (_prev : Framebuffer.framebuffer) : Framebuffer.framebuffer = | |
let ft = (Float.of_int t) *. 0.02 in | |
let buffer = Framebuffer.init screen.width screen.height (fun _x _y -> 0) in | |
for z = 0 to 75 do | |
let fz = (Float.of_int z) *. 8. in |
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
let usage_msg = "cat <file1> [<file2>] ... -o <output>" | |
let input_files = ref [] | |
let output_file = ref "" | |
let anon_fun filename = input_files := !input_files @ [filename] | |
let speclist = [ | |
("-o", Arg.Set_string output_file, "Set output file name"); | |
] |
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 simple table of numbers contract that I used to let me compare the costs in Tez for different | |
// update mechanisms. With this contract you can do the following | |
// | |
// * Add_direct - lets you update the big map in the contract's storage directly | |
// * Add_lambda - lets you update the big map using a function stored in storage not in the contract directly | |
// * Add_indirect - lets you call the add_direct method of the contract nominated as a replacement | |
// * Add_follow_list - lets you follow a chain of replacements until the last contract in the chain | |
// | |
// There is also a set/clear replacement address pair of entrypoints. |
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 python3 | |
class Foo: | |
def __init__(self, lhs, op=None, rhs=None): | |
self.lhs = lhs | |
if op: self.op = op | |
if rhs: | |
if len(lhs) != len(rhs): | |
raise ValueError("Mismatched array sizes") |
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 python3 | |
class Foo: | |
def __init__(self, lhs, op=None, rhs=None): | |
self.lhs = lhs | |
if op: self.op = op | |
if rhs: self.rhs = rhs | |
def __str__(self): |
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
func testNotYAMLFront() throws { | |
let testdoc = """ | |
--- | |
{"title": "hello, world"} | |
--- | |
""" | |
// I only use a YAML parser, so this should throw | |
// XCTAssertThrowsError(try FrontMatterDocument(data: Data(testdoc.utf8))) { error in | |
// XCTAssertEqual(error as? FrontMatterDocumentError, .FailedToParseYAML) | |
// } |
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 Dispatch | |
import Foundation | |
let syncQ = DispatchQueue(label: "sync") | |
var count = 0 | |
let q = DispatchQueue(label: "test") | |
func test() { | |
syncQ.sync { |
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 python | |
import sys | |
import atheris | |
import django | |
from django.test import Client | |
from django.urls import URLPattern, URLResolver, reverse, NoReverseMatch | |
from django.urls.resolvers import RegexPattern, RoutePattern | |
from django.urls.converters import StringConverter, IntConverter |
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
Process: boundless [59578] | |
Path: /Users/USER/Library/Application Support/Steam/*/boundless.app/Contents/MacOS/boundless | |
Identifier: com.turbulenz.boundless | |
Version: 1.0 (1) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: boundless [59578] | |
User ID: 501 | |
Date/Time: 2018-06-23 11:04:59.128 +0100 |
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
Process: boundless [4690] | |
Path: /Users/USER/Library/Application Support/Steam/*/boundless.app/Contents/MacOS/boundless | |
Identifier: com.turbulenz.boundless | |
Version: 1.0 (1) | |
Code Type: X86-64 (Native) | |
Parent Process: ??? [1] | |
Responsible: boundless [4690] | |
User ID: 501 | |
Date/Time: 2018-06-16 20:42:08.326 +0100 |
NewerOlder