Skip to content

Instantly share code, notes, and snippets.

@bobbyzhu
bobbyzhu / arch_linux_installation_guide.md
Created September 1, 2024 14:37 — forked from mjkstra/arch_linux_installation_guide.md
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@bobbyzhu
bobbyzhu / arch_linux_installation_guide.md
Created September 1, 2024 14:37 — forked from mjkstra/arch_linux_installation_guide.md
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
template <typename Left, typename Right>
struct ConcatExpr;
template <typename Left, typename Right>
struct AltExpr;
template <typename SubExpr>
struct RepeatExpr;
template <char ch>
@bobbyzhu
bobbyzhu / c99.l
Created July 29, 2017 03:11 — forked from codebrainz/c99.l
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@bobbyzhu
bobbyzhu / example.c
Last active September 1, 2015 06:34 — forked from dspezia/example.c
Example of Redis zset polling daemon
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include "hiredis.h"
#include "async.h"
#include "adapters/ae.h"
#include "sha1.h"
//
// Generate benchmarks for the three queue implementations shown in
// Jeff Preshing's CppCon 2014 talk, "How Ubisoft Montreal Develops Games for
// Multicore - Before and After C++11".
//
// Slides: https://github.com/CppCon/CppCon2014/blob/master/Presentations/How%20Ubisoft%20Montreal%20Develops%20Games%20for%20Multicore/How%20Ubisoft%20Montreal%20Develops%20Games%20for%20Multicore%20-%20Before%20and%20After%20C++11%20-%20Jeff%20Preshing%20-%20CppCon%202014.pdf?raw=true
//
#include <iostream>
#include <atomic>
@bobbyzhu
bobbyzhu / inject.lua
Last active August 29, 2015 14:15 — forked from cloudwu/inject.lua
local FUNC_TEMP=[[
local $ARGS
return function(...)
$SOURCE
end,
function()
return {$LOCALS}
end
]]
@bobbyzhu
bobbyzhu / linkmap.js
Last active August 29, 2015 14:14 — forked from bang590/linkmap.js
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
@bobbyzhu
bobbyzhu / README.txt
Last active August 29, 2015 14:09 — forked from klzgrad/00-README.txt
$ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8
;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了
;; Question section mismatch: got twitter.com/RESERVED0/CLASS256
; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

fdssd