Skip to content

Instantly share code, notes, and snippets.

@Myriad-Dreamin
Myriad-Dreamin / libuv-tcp-client.c
Created July 10, 2021 07:06 — forked from snatchev/libuv-tcp-client.c
a libuv evented tcp client
#include <stdio.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static uv_loop_t *loop;
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t size) {
package main
import (
"fmt"
"math/bits"
)
type StorageSizeUnit = int
const (
B StorageSizeUnit = iota
import platform
import typing
import tempfile
import subprocess
import os
import argparse
from pathlib import Path
try:
@Myriad-Dreamin
Myriad-Dreamin / backtrace.py
Created December 30, 2020 06:55
automate gdb backtrace
# insert root directory
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent.absolute()))
from scripts.gdb.wrap_gdb import gdb_ins
from scripts.gdb import backtrace_parser
# import asyncio
// # kamiyoru at DESKTOP-UDO3FER in ~\work\c [18:02:33]
// $ g++ .\test.cpp -std=c++17 -o o
// # kamiyoru at DESKTOP-UDO3FER in ~\work\c [18:02:54]
// $ .\o.exe
// 1 2 3 4 5
#include <iostream>
template <typename ...Args>
{
// editor.wordSeparators: 単語単位での移動を行う場合の区切り文字を指定
// 日本語文書で単語移動を使うため、助詞や読点、括弧を区切り文字として指定する
"editor.wordSeparators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~? 、。「」【】『』()!?てにをはがのともへでや的得地了",
"editor.fontSize": 24,
// 設定: LaTeX Workshop
// https://qiita.com/popunbom/items/7d02fc75ad23b735d28c#vscode-%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB
class MacroState(enum.Enum):
Nothing = 0
IfMatching = 1
Skipping = 2
def match_function_body(content, start):
cnt = 0
hash_reading = None
skip_macro = MacroState.Nothing
for i in range(start, len(content)):
#!/bin/bash
# echo $@
# echo $1
GIT_FUCK_RETRY_TIMES=${GIT_FUCK_RETRY_TIMES:=5}
retry_times=0
until [ "$retry_times" -ge $GIT_FUCK_RETRY_TIMES ]
do
import re
import os
import json
from collections import deque
if __name__ == '__main__':
with open('build/fake-include/fuzzer-fake-include-all.inc', 'r', encoding='utf8') as f:
wif = False
the_wif = ''
pre_decls = []
class Map {
MapType<Legend> m;
public:
Map();
~Map();
MapType<Legend> view_map();
void set_map(std::pair<int, int> point, const VecMapType<Legend>& v);