Skip to content

Instantly share code, notes, and snippets.

@matvore
matvore / gist:301f2cf8ba0fc7699ddf26e55274a6bc
Created October 2, 2023 13:56
putc vs buffering benchmark
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
static FILE *fin, *fout;
static void byteperbyte(void)
{
int c;
# Use to build https://github.com/matvore/nfs-ganesha on macOS
cflags="-DHAVE_STRNLEN=1 -DHAVE_STRLCPY=1 -DHAVE_STRLCAT=1 \
-Wno-deprecated-declarations"
cmake --clean-first \
-DTIRPC_EPOLL:BOOL=OFF
-DBISON_EXECUTABLE:FILEPATH=$BREW_PREFIX/opt/bison/bin/bison \
-DUSE_FSAL_VFS:BOOL=OFF \
-DUSE_FSAL_XFS:BOOL=OFF \
<!doctype html>
<html>
<head>
<title>js-keygen</title>
<script>
// adapted from https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-08#appendix-C
function base64urlEncode(arg) {
const step1 = window.btoa(arg); // Regular base64 encoder
@matvore
matvore / foo.java
Last active August 20, 2018 17:19
Demonstrate encoding with ASCII and UTF-8
import java.io.*;
public final class foo {
public static void main(String[] args) throws Exception {
byte b[] = {(byte) 0x80, (byte) 0xe3, (byte) 0x81, (byte) 0xbb};
ByteArrayInputStream is = new ByteArrayInputStream(b);
Reader r = new InputStreamReader(is, "ASCII");
System.out.println("ASCII:");
while (true) {
int c = r.read();
$ hg outgoing
comparing with https://bitbucket.org/octobus/evolve-devel
searching for changes
changeset: 2633:fc64028a3dc0
user: Pulkit Goyal <[email protected]>
date: Tue Jul 04 17:10:21 2017 +0530
summary: prev: factor out the logic to update to previous commit to a new function
changeset: 2634:0ba8ae0ced24
user: Pulkit Goyal <[email protected]>
@matvore
matvore / gist:1fe576898b7cc42aa0cf41d102d0cc99
Created October 5, 2017 17:17
hg log -G -r "branch(default)"
$ hg log -G -r "branch(default)" (first 40 lines)
@ changeset: 3359:488c9223c1ad
| tag: tip
| parent: 3349:2d42bd025754
| user: Matt DeVore <[email protected]>
| date: Tue Oct 03 11:14:29 2017 -0700
| summary: obscache: do not check of argument count of wrapped function
|
| o changeset: 3358:7def8adf53d6
| | user: Pulkit Goyal <[email protected]>
pri 5 - 4543 assigned (94.49%), 265 unassigned, 4808 total:
舀玀     舨暨榨玨皂舢焊蜢謊漪踢躂
蛀蓀 筠      懂 麂鏢烊飪鎢鎊鎂
絀邐砰鈐 闈碘瘸砸  鐲渲   睪颺 
   胰   荸菸 賒籲    蹺  
 犄      銬 梆氦   鐮氮  
 瞄 疤桌蹬瞌賬徬  蹦惦    涮殮
罄舔     睬臬彆跆迆銼闆旎盎籮翎跎
龔鼴趴渴 璜 紼脖氖 錶   螞騖颼鈾
湔盔軔燴煜燜慼睜盼牖旖轔遴鏜睞陴靶饜篾
pri 5 - 4511 assigned (93.82%), 297 unassigned, 4808 total:
舀玀     舨榨抨暨玨皂舢焊蜢搪挪漪謊
蛀蓀 筠     捂懂麂飪鏢鎢烊鎊鎂躂踢
絀撐砰邐鈐闈碘瘸砸  鐲 渲   睪颺 
  胰擰     摒扒賒    拚蹺  
 犄     荸菸銬 梆籲       
瞄掄 疤 桌瞌 撬徬  氦惦 鐮拎氮涮殮
        臬賬捆跆蹦蹬迆捎旎盎籮跎
舔罄闆渴銼脖璜睬氖挖彆 錶 搞 翎鈾  
摔攔湔盔拴趴軔慼紼盼牖遴陴颼騖鱔螞鱖鼴龔
pri 5 - 4504 assigned (93.68%), 304 unassigned, 4808 total:
舀 玀     舨抨暨榨玨皂舢焊蜢搪挪漪謊
蛀蓀   弈    捂懂 麂飪鎢烊鎊鎂躂踢
絀撐砰筠邐鈐碘闈瘸砸  鐲渲鏢   睪颺 
   胰      扒      拚   
   擰    荸菸摒賒 籲    蹺  
 犄掄     撬銬 梆 氦   鐮氮涮殮
  瞄疤 桌 瞌臬徬崆捆賬蹦惦捎蹬拎盎籮 
舔罄 渴騖颼闆銼睬跆氖彆迆 跎搞旎翎鈾  
攔 遴鼴拴趴璜龔紼 挖牖脖錶   螞   
pri 5 - 4485 assigned (93.28%), 323 unassigned, 4808 total:
舀 玀     舨抨暨榨玨皂舢焊蜢搪挪漪謊
蛀蓀   弈    捂懂麂飪鎢烊婊鎊鎂躂踢
絀撐砰筠邐鈐碘闈瘸砸  鐲渲媲鏢  睪颺 
   胰    嬸 扒      拚   
   擰  姘 荸菸摒賒 籲    蹺  
 犄掄嬤 娌 尬撬銬 梆 氦  鐮涮氮妮殮
  瞄疤 桌 瞌臬徬崆捆賬蹦惦捎蹬拎盎籮 
舔罄 渴騖颼闆銼睬跆氖彆迆 跎搞旎翎鈾  
攔 遴嬴拴趴璜鼴紼龔挖牖脖錶  妞螞