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/bash | |
# See https://github.com/ziglang/zig/commit/22cd7156a48136017656b4c9309bba9041a46bfd | |
cd .. && zig build-lib --zig-lib-dir $HOME/src/zig/lib zig_hashes.zig -O ReleaseFast -femit-bin=zig_hashes.a | |
cd build && make |
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 builtin = @import("builtin"); | |
const Builder = std.build.Builder; | |
pub fn build(b: *Builder) void { | |
const exe = b.addExecutable("fuzz", "fuzz.zig"); | |
exe.setBuildMode(builtin.Mode.ReleaseFast); | |
exe.linkSystemLibrary("c"); | |
exe.linkSystemLibrary("gmp"); | |
exe.setOutputDir("."); |
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 time = std.os.time; | |
const Timer = time.Timer; | |
const poly1305 = @import("poly1305.zig"); | |
const MiB = 1024 * 1024; | |
const BytesToHash = 128 * MiB; | |
pub fn main() !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
std/os/linux_x86_64.zig | 14 +++++++------- | |
1 file changed, 7 insertions(+), 7 deletions(-) | |
diff --git a/std/os/linux_x86_64.zig b/std/os/linux_x86_64.zig | |
index 0f8f163..9a3282a 100644 | |
--- a/std/os/linux_x86_64.zig | |
+++ b/std/os/linux_x86_64.zig | |
@@ -370,14 +370,14 @@ pub const F_GETOWN_EX = 16; | |
pub const F_GETOWNER_UIDS = 17; |
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
#include "qvec.h" | |
typedef char* string; | |
typedef struct { | |
int x, y; | |
} Tuple; | |
int main(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
#!/usr/bin/bash | |
echo -e "\n256-color approximation\n" | |
for i in `seq 0 255`; do | |
printf "\x1b[48;5;${i}m \x1b[0m - " | |
./target/debug/rg 'door-m' grep/src/data/sherlock.txt --colors "match:bg:$i" --colors "match:fg:$i" --only-matching -N | |
done | |
echo -e "\nTrue-color approximation\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
macro_rules! foo { | |
($id:ident) => { | |
struct $id {} | |
fn new() -> &'static $id { | |
$id {} | |
} | |
} | |
} |