View notes_profile
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
function tn { | |
local EDITOR=${TAKE_NOTE_EDITOR:-"vim"} | |
local DIRECTORY=${TAKE_NOTE_DIRECTORY:-"${HOME}/.notes"} | |
local ACTIVE_NOTE=${TAKE_NOTE_ACTIVE_NOTE:-"note-$(date +%Y-%m-%d)"} | |
if [ "${#}" == "0" ]; then | |
${EDITOR} ${DIRECTORY}/${ACTIVE_NOTE} | |
else | |
printf "[%s] %s\n" "$(date +%H:%M:%S)" "${*}" | tee -a ${DIRECTORY}/${ACTIVE_NOTE} | |
fi |
View Makefile
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
FLAGS = -std=c++20 -stdlib=libc++ -fcoroutines-ts -lpthread | |
INC = -I/usr/lib/llvm-13/include/c++/v1 | |
coroutine: coroutine.o | |
clang++ $(FLAGS) $(INC) coroutine.o -o coroutine | |
coroutine.o: coroutine.cpp | |
clang++ $(FLAGS) $(INC) -c coroutine.cpp -o coroutine.o | |
clean: |
View do-calculus-backdoor-finder.py
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
""" | |
Copyright 2021 stormouse | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
View parse_perf_script.py
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
# usage: python this.py <(perf script -i perf.data -F comm,tid,time,ip,sym,cpu,event) | |
import fileinput | |
proc_sample_total = 0 | |
cpu_inc = {} | |
cpu_ext = {} | |
comm = '<your-process-name>'[:15].lower() | |
interested = True |
View http-pcap.cs
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
void Main() | |
{ | |
var readerFactory = new PacketReaderFactory(); | |
var packetReader = readerFactory.Create(@"<>.pcap"); | |
IDisplayer displayer = DisplayerFactory.Text(System.Console.Out); | |
Dictionary<(int, int), HttpRequestCutter> comms = new Dictionary<(int, int), UserQuery.HttpRequestCutter>(); | |
foreach (var packet in packetReader.ReadPackets()) | |
{ |
View sketch_201206a.pde
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
// algo | |
int minBlockWidth = 2; | |
int minBlockHeight = 2; | |
int maxBlockWidth = 5; | |
int maxBlockHeight = 5; | |
class Block | |
{ | |
color c; |
View pbd-distance-constraint-example.js
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
// you can try it out on https://editor.p5js.org/ | |
class Constraint { | |
constructor(constraintType, updateFunc, stiffness) { | |
this.ctype = constraintType; | |
this.f = updateFunc; | |
this.stiffness = stiffness; | |
} | |
project(verts) { |
View jf_nbi.cs
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
void Main() | |
{ | |
var exampleJson = @" | |
{ | |
""random"": 37, | |
""random float"": 51.886, | |
""bool"": true, | |
""date"": ""1982-05-19"", | |
""regEx"": ""hellooooooooo to you"", | |
""enum"": ""json"", |
View draft.cxx
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
void main() | |
{ | |
start_network(); | |
start_game(); | |
} | |
void network(callback on_receive_a, callback on_receive_b) | |
{ | |
while(1) | |
{ |