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
const std = @import("std"); | |
const system = switch (std.builtin.os.tag) { | |
.linux => std.os.linux, | |
else => std.os.system, | |
}; | |
const ThreadPool = @This(); | |
max_threads: u16, | |
counter: u32 = 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
// zig test bls.zig -I/usr/include -lc -lstdc++ -L/usr/lib -lbls_c256 | |
const std = @import("std"); | |
const assert = std.debug.assert; | |
const testing = std.testing; | |
const BLS = struct { | |
const curves = enum { | |
bls_c256, | |
bls_c384, |
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
pkgname=("lua-$_rockname" "lua51-$_rockname" "lua52-$_rockname") | |
makedepends+=('luarocks' 'lua' 'lua51' 'lua52') | |
build() { | |
for lua_ver in 5.1 5.2 5.3; do | |
mkdir -p "$lua_ver" | |
(cd "$lua_ver"; luarocks build --pack-binary-rock --lua-version="$lua_ver" --deps-mode=none --no-manifest "$_rockname"-"$pkgver"-*.rockspec) | |
done | |
} |
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
EVIL |
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
begin; | |
-- Load in uuid-ossp extension for uuid_generate_v1mc | |
create schema "uuid-ossp"; | |
create extension "uuid-ossp" with schema "uuid-ossp"; | |
-- Create roles | |
create role alice; | |
create role bob; |
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
luarocks (3.1.3-1) unstable; urgency=medium | |
* New upstream release | |
-- Daurnimator <[email protected]> Fri, 07 Jun 2019 15:00:00 +1000 | |
luarocks (2.4.2+dfsg-1) unstable; urgency=medium | |
* New upstream release | |
* Support lua 5.1, 5.2 and 5.3 via lua-any |
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
/// Reverse Variable-length Bit-strings | |
/// | |
/// Marshal and unmarshal an integer into a reverse bit-string; | |
/// that is, written out right-to-left (in cardinality of memory space). | |
fn ReverseVariableLengthInteger(comptime rbitsint: type) type { | |
return struct { | |
/// Maximum space needed to store an rbitsint | |
pub const maxLen: usize = (rbitsint.bit_count + 6) / 7; | |
/// Return the buffer size required to hold an rbitsint value bit-string |
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
const std = @import("std"); | |
const A = struct { | |
pub foo: i32, | |
pub fn foo() void { | |
} | |
}; | |
test "shadowing" { | |
std.debug.warn("{}", @typeName(@typeOf(A.foo))); // fn() void |
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
// HTTP Header data structure/type | |
// Based on lua-http's http.header module | |
// | |
// Design criteria: | |
// - the same header field is allowed more than once | |
// - must be able to fetch seperate occurences (important for some headers e.g. Set-Cookie) | |
// - optionally available as comma seperated list | |
// - http2 adds flag to headers that they should never be indexed | |
// - header order should be recoverable | |
// |
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
const std = @import("std"); | |
const assert = std.debug.assert; | |
const lua_ABI = @cImport({ | |
@cInclude("lua.h"); | |
@cInclude("lauxlib.h"); | |
@cInclude("lualib.h"); | |
}); | |
pub const lua = struct { |
NewerOlder