Skip to content

Instantly share code, notes, and snippets.

View nbkolchin's full-sized avatar

Nickolay Semyonov nbkolchin

  • Wolpike
View GitHub Profile
@nbkolchin
nbkolchin / gen.sh
Last active January 14, 2022 15:07
1.2m lines compiling
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Usage: gen.sh [lines count]"
exit 0
fi
if [ "x$1" != "x" ]; then
LIMIT=$1
else
@nbkolchin
nbkolchin / bufio.4th
Created October 24, 2021 10:42
Naive buffered read-line
[UNDEFINED] RDROP [IF]
: RDROP POSTPONE R> POSTPONE DROP ; IMMEDIATE
[THEN]
[UNDEFINED] BUFFER: [IF]
: BUFFER: CREATE ALLOT ;
[THEN]
BEGIN-STRUCTURE (bufio-struct)
FIELD: (bufio-file) \ file handle
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <sys/mman.h>
#include <pthread.h>
#define BOOL bool
#define FALSE false
Tracing enabled @ Sun Mar 15 16:30:28 2020 UTC
--- Invoked dotnet [version: 3.1.2, commit hash: 916b5cba268e1e1e803243004f4276cf40b2dda8] main = {
dotnet
fsi
}
Reading fx resolver directory=[/usr/local/share/dotnet/host/fxr]
Considering fxr version=[3.1.2]...
Detected latest fxr version=[/usr/local/share/dotnet/host/fxr/3.1.2]...
Resolved fxr [/usr/local/share/dotnet/host/fxr/3.1.2/libhostfxr.dylib]...
Invoking fx resolver [/usr/local/share/dotnet/host/fxr/3.1.2/libhostfxr.dylib] v2
( Tic-Tac-Toe benchmark for https://github.com/BartMassey/ttt-bench )
VARIABLE BOARD 9 CELLS ALLOT BOARD 9 CELLS ERASE
: B@ CELLS BOARD + @ ;
: B! CELLS BOARD + ! ;
: NEGALINE ( a b c - filled )
B@ SWAP B@ + SWAP B@ + ABS 3 =
;
@nbkolchin
nbkolchin / gist:8a325a06d616788ce192bc0f44e32437
Created April 3, 2016 13:18
Parallels diff for Linux 4.5
--- inode.c.orig 2016-02-16 18:23:37.000000000 +0300
+++ inode.c 2016-04-03 00:08:38.719000000 +0300
@@ -620,6 +620,9 @@
char *buf, *src_path, *tgt_path;
int src_len, tgt_len, ret;
+ if(!dentry)
+ return ERR_PTR(-ECHILD);
+
tgt_path = NULL;
graph "_%1_cc_0" {
graph [bb="0,0,670,213"];
node [label="\N"];
subgraph cluster_0 {
graph [bb="8,8,662,205",
label=1
];
subgraph cluster_1 {
graph [bb="440,16,582,91",
label=2
@nbkolchin
nbkolchin / memleak.go
Last active December 14, 2015 20:19
Demonstrate potential memory leak in fsnotify.
package main
import (
"log"
"os"
"github.com/howeyc/fsnotify"
"runtime"
)
func main() {
c := make(chan int)
@nbkolchin
nbkolchin / gist:5137058
Created March 11, 2013 19:43
MacOSX bug demo.
package main
import (
"log"
"os"
"github.com/howeyc/fsnotify"
)
func main() {
c := make(chan int)