Skip to content

Instantly share code, notes, and snippets.

@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active March 13, 2024 17:32
Unofficial R2 notes

锁表原因?

我想了一下最可能造成此次锁表的原因。你是程序在线的时候执行的knex-migrate up吗?那样这次是有可能锁死。 如果你cherry-pick了 935681b14f4f41a6af27977d5cc1cae6c2f5817a 这个是为了解决之前打错字的情况,也为了这次你执行knex-migrate up能正确运行而不至于直接挂在前面的错误文件上。

当你执行knex-migrate的时候,它会读取knex_migrations表,对比没有执行过的migration文件,然后执行并把完成的migration记录文件名到这个表里面。

也就是说本次你应该是看到执行了两个migration:
20210223200240_drop_not_null_constraints.js
20210304101412_fix_view_userMetatdata.js

@niw
niw / README.en.md
Last active May 17, 2025 15:02
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@devrishik
devrishik / PostgreSQL JSON Indexing and Django Models references
Last active January 10, 2024 17:36
A quick cook book to Postgres indexes and Django model references
Django provides references to all of the existing indexes in Postgres.
Django managers can be used for managing indexes dynamically, a handle
can be provided as IndexManager to extend for custom querysets or raw sql queries.
PostGres
--------
Types of indexes: https://www.postgresql.org/docs/9.1/indexes-types.html
BRIN: Block Range Index: good for comparing blocks with relative location data
Btree (default): @> <> =:
@groundcat
groundcat / Block_Baidu_Input_HOSTS.txt
Last active July 19, 2025 13:24
屏蔽搜狗/百度输入法后台联网
#<block-baidu>
127.0.0.1 olime.baidu.com
127.0.0.1 dr-ime.baidu.com
127.0.0.1 updateime.baidu.com
127.0.0.1 tips.ime.baidu.com
127.0.0.1 typing.bae.baidu.com
127.0.0.1 pcinput.baidu.com
#</block-baidu>
@sochix
sochix / app.js
Created April 16, 2019 15:48
Proper way to measure request duration in a Node.js + Express application
const app = require('express')()
const getDurationInMilliseconds = (start) => {
const NS_PER_SEC = 1e9
const NS_TO_MS = 1e6
const diff = process.hrtime(start)
return (diff[0] * NS_PER_SEC + diff[1]) / NS_TO_MS
}
@kamiaka
kamiaka / normalizeUTF8MacKana.php
Last active July 26, 2022 10:29
Replace Japanese Kana from UTF-8-MAC to UTF-8 for any env.
<?php
/**
* Replace Japanese Kana from UTF-8-MAC to UTF-8 for any env.
*
* code is generated
*
* @param string utf-8-mac string
* @return string utf-8 string
*/
@cnDelbert
cnDelbert / How to install tcpping on Linux.md
Last active December 23, 2024 21:15
How to install tcpping on Linux

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute