Skip to content

Instantly share code, notes, and snippets.

@zmwangx
zmwangx / fonts.reg
Created October 20, 2018 17:19
How to make Chinese filenames not so ugly in Windows 10
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe UI (TrueType)"="-segoeui.ttf"
"Segoe UI Black (TrueType)"="-seguibl.ttf"
"Segoe UI Black Italic (TrueType)"="-seguibli.ttf"
"Segoe UI Bold (TrueType)"="-segoeuib.ttf"
"Segoe UI Bold Italic (TrueType)"="-segoeuiz.ttf"
"Segoe UI Emoji (TrueType)"="-seguiemj.ttf"
"Segoe UI Historic (TrueType)"="-seguihis.ttf"
@lnanase
lnanase / 5000choyen.js
Created October 10, 2018 04:04
5000兆円ジェネレーター(node.js)
const fs = require('fs');
const Canvas = require('canvas');
var offset = { top: {x: 0, y: 0}, bottom: {x: 250, y: 130} };
var actualWidth = { top: 0, bottom: 0 };
if (process.argv.length < 3) {
console.error('Usage: 5000choyen.js "text1" ["text2"]');
process.exit(1);
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 14, 2024 20:22
set -e, -u, -o, -x pipefail explanation
@jivoi
jivoi / gist:a33ace2e25515a31aa2ffbae246d98c9
Created June 14, 2017 13:27
Serving Random Payloads with NGINX
# Serving Random Payloads with NGINX
# add set_random module https://github.com/openresty/set-misc-nginx-module#set_random
# edit file /etc/nginx/sites-enabled/default
set_random $uri 1 3;
map $uri $payloads {
1 /payload.lnk;
2 /payload.hta;
3 /payload.exe;
@ljw1004
ljw1004 / tuple_perf.cs
Created April 20, 2017 15:02
Perf comparison ValueTuple vs Tuple vs KeyValuePair
// TUPLE MICRO-BENCHMARKS, based on https://www.dotnetperls.com/tuple-keyvaluepair
//
// Tuples are generally fastest.
// ValueTuple is fastest in the particular case of GetHashCode.
// KeyValuePair is always worst.
//
//
// RAW RESULTS
// Numbers in milliseconds (lower is better)
//
@FrankHB
FrankHB / faq.md
Last active May 19, 2024 10:43
贴吧相关 FAQ 、资源链接和其它附带清单。

FAQ

包含若干待定整理内容。

待补充

const/常量表达式(constant expression) 的联系和不同。

参考:

@ishu3101
ishu3101 / gist_to_github_repo.md
Created November 24, 2015 08:35
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@Two9A
Two9A / decronym.php
Last active April 9, 2024 23:25
Decronym: A simple Reddit bot
<?php
/**
* Dirty, dirty Reddit bot: Decronym
*/
class Reddit {
const USERNAME = 'Decronym';
const PASSWORD = '***';
const CLIENTID = '***';
const SECRET = '***';

Downloading and Syncing Archive.org Collections

Following are instructions on how to use the Internet Archive command-line tool, "ia", to download a collection from Archive.org and keep it synced. The only requirements are that you have Python 2 installed on a Unix-like operating system (i.e. Mac OS X, Linux).

Downloading and Configuring the Ia Command-Line Tool

  1. Download the latest binary of the ia command-line tool:
@kshchepanovskyi
kshchepanovskyi / about_message_field_default_value.md
Last active May 22, 2023 14:57
Protobuf: message field and default values

About default value for message fields

If field type is message, what should getter return if it is not set?

Proto2 specification does not define default value for message type, it is defined only for scalar types:

If the default value is not specified for an optional element, a type-specific