Skip to content

Instantly share code, notes, and snippets.

@false-git
false-git / uuid_test.cc
Last active May 14, 2023 05:20
UUIDの衝突が起きるかテストするプログラム (バージョン2)
// c++ -std=c++20 -O2 uuid_test.cc
#include <chrono>
#include <iostream>
#include <thread>
#include <memory>
#include <set>
#include <vector>
#include <uuid/uuid.h>
struct Uuid {
@false-git
false-git / uuid_test.cc
Last active May 14, 2023 02:21
UUIDの衝突が起きるかテストするプログラム
// c++ -std=c++20 -O2 uuid_test.cc
#include <chrono>
#include <iostream>
#include <thread>
#include <mutex>
#include <set>
#include <vector>
#include <uuid/uuid.h>
struct Uuid {
@false-git
false-git / patch-freebsd.c
Created November 13, 2021 00:16
FreeBSD の zabbix54-agent で net.if.discovery に失敗する問題に対応するパッチ
--- src/libs/zbxsysinfo/freebsd/freebsd.c.orig 2021-11-13 09:05:42.172000000 +0900
+++ src/libs/zbxsysinfo/freebsd/freebsd.c 2021-11-13 09:05:57.725120000 +0900
@@ -41,7 +41,7 @@
{"net.if.out", CF_HAVEPARAMS, NET_IF_OUT, "lo0,bytes"},
{"net.if.total", CF_HAVEPARAMS, NET_IF_TOTAL, "lo0,bytes"},
{"net.if.collisions", CF_HAVEPARAMS, NET_IF_COLLISIONS, "lo0"},
- {"net.if.discovery", 0, NET_IF_DISCOVERY, "lo0"},
+ {"net.if.discovery", 0, NET_IF_DISCOVERY, NULL},
{"vm.memory.size", CF_HAVEPARAMS, VM_MEMORY_SIZE, "free"},
@false-git
false-git / userscript.js
Last active July 30, 2021 13:55
自衛隊東京ワクチン接種web予約 autofill
// ==UserScript==
// @name 自衛隊東京ワクチン接種web予約
// @version 1
// @grant none
// @include https://www.vaccine.mrso.jp/sdftokyo/VisitNumbers/visitnoAuth*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// ==/UserScript==
(function($){
$('#VisitnoAuthName').val("市区町村コード");
@false-git
false-git / .gitconfig
Last active August 5, 2019 22:55
git config
[alias]
st = status -sb
[push]
default = simple
[core]
quotepath = false
[pager]
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
#include <iostream>
class I {
private:
int value;
public:
I(int i): value(i) {}
I operator+(int i) const {
return I(value - i);
}
@false-git
false-git / parity.c
Created February 11, 2017 13:38
偶数パリティの計算
#include <stdio.h>
#include <stdint.h>
/*!
* \brief 7bitの数値を渡すと、偶数パリティを8bit目に入れる
* \param[in] val 7bitの数値
* \return 8bit目に偶数パリティを追加したもの
*/
uint32_t parity(uint32_t val) {
uint32_t orig = (val &= 0x7f);
#include <iostream>
class A {
public:
void method() {
std::cout << "A::method" << std::endl;
}
virtual void vmethod() {
std::cout << "A::vmethod" << std::endl;
}
@false-git
false-git / makejman.sh
Last active August 29, 2015 14:17
FreeBSD のmanを日本語対応する
PDIR=`pwd`
fetch https://gist.githubusercontent.com/false-git/7183d616527e8efda181/raw/7613fcea21e1a00618bc395878586ec6189af964/man.patch
fetch https://gist.githubusercontent.com/false-git/7183d616527e8efda181/raw/53c7ab2196c61be336e910a66a6b9423457193b9/mdoc.local.add
fetch https://gist.githubusercontent.com/false-git/7183d616527e8efda181/raw/fe5aa7e9aa3e1e68a0bf780eb69dac01f41da44e/man.local.add
fetch http://distcache.FreeBSD.org/local-distfiles/hrs/tmac-20030521_2.tar.gz
cp /usr/bin/man /usr/local/bin/
cd /usr/local/bin/
patch < $PDIR/man.patch
cd /usr/local/share/groff/site-tmac
V=`uname -r|sed 's/-.*//'`
@false-git
false-git / quazip.patch
Last active March 17, 2016 08:52
quazip(http://quazip.sourceforge.net/) を Mac OS Xでビルドするためのパッチ
*** quazip/quazip.pro.orig 2015-03-12 13:50:17.000000000 +0900
--- quazip/quazip.pro 2015-03-13 13:19:12.000000000 +0900
***************
*** 44,49 ****
--- 44,54 ----
}
+ macx {
+ QMAKE_LIBS += -lz