Skip to content

Instantly share code, notes, and snippets.

@jpierson
jpierson / min-max-dates.md
Last active May 14, 2024 12:16
A summary of min/max date values used by various systems

Summary of Min/Max date values for various systems

System/Type Min Max Notes
.NET (DateTime) 1/1/0001 12:00:00 AM 12/31/9999 11:59:59 PM
T-SQL (datetime) January 1, 1753 December 31, 9999 Default value is 1900-01-01 00:00:00
Oracle (DATE) 0001-01-01 9999-12-31
Oracle (TIME) 00:00:00 24:00:00
Oracle (TIMESTAMP) 0001-01-01-00.00.00.000000 9999-12-31-23.59.59.999999
ISO 8601 1583-01-19T0:00:00Z 9999-12-31T023:59:59Z
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 14, 2024 12:13
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rsms
rsms / macos-distribution.md
Last active May 14, 2024 12:12
macOS distribution — code signing, notarization, quarantine, distribution vehicles
@csullivan
csullivan / passthrough_notes.md
Last active May 14, 2024 12:12
QEMU/KVM GPU passthrough on 18.04 LTS notes

For blacklisting an Nvidia GTX1070 gpu on Ubuntu 18.04 with Intel integrated graphics for the host

Blacklist the nvidia driver:

sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf" 
sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"

/etc/default/grub:

@greymd
greymd / sudo新一.md
Last active May 14, 2024 12:10
sudo新一

 オレは高校生シェル芸人 sudo 新一。幼馴染で同級生の more 利蘭と遊園地に遊びに行って、黒ずくめの男の怪しげな rm -rf / 現場を目撃した。端末をみるのに夢中になっていた俺は、背後から近づいてきたもう1人の --no-preserve-root オプションに気づかなかった。 俺はその男に毒薬を飲まされ、目が覚めたら・・・ OS のプリインストールから除かれてしまっていた!

sudo がまだ $PATH に残っていると奴らにバレたら、また命を狙われ、他のコマンドにも危害が及ぶ』

 上田博士の助言で正体を隠すことにした俺は、 which に名前を聞かれて、とっさに『gnuplot』と名乗り、奴らの情報をつかむために、父親がシェル芸人をやっている蘭の $HOME に転がり込んだ。ところが、このおっちゃん・・・とんだヘボシェル芸人で、見かねた俺はおっちゃんになりかわり、持ち前の権限昇格能力で、次々と難タスクを解決してきた。おかげで、おっちゃんは今や世間に名を知られた名エンジニア、俺はといえばシェル芸 bot のおもちゃに逆戻り。クラスメートの convertojichattextimg にお絵かきコマンドと誤解され少年ワンライナーお絵かき団を結成させられる始末。

 ではここで、博士が作ってくれたメカを紹介しよう。最初は時計型麻酔 kill 。ふたについた照準器にあわせてエンターを押せば、麻酔シグナルが飛び出し、プロセスを瞬時に sleep させることができる。 次に、蝶ネクタイ型 banner 。裏についているダイヤルを調整すれば、ありとあらゆる大きさのメッセージを標準出力できる。必殺のアイテムなら fork 力増強シューズ。電気と磁力で足を刺激し、 :(){ :|:&amp; };: でプロセステーブ

@vidarh
vidarh / rubywm.rb
Created November 21, 2023 20:16
rubywm.rb - a minimalist WM using pure-x11 and based on TinyWM
# Based on TinyWM by Nick Welch
require 'X11'
dpy = X11::Display.new
root = dpy.screens.first.root
# OK, so pure-x11 *really* badly needs built in keysym lookup,
# but I don't want to add that without doing it properly, so this
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 14, 2024 12:10
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@joseluisq
joseluisq / mysql_query_log.md
Last active May 14, 2024 12:10
How to enable the MySQL/MariaDB general query logs

How to enable the MySQL/MariaDB general query logs

  1. Enter to MySQL/MariaDB server command-line tool (change root with your username and password):
mysql -u root -proot
  1. Set the general log file path:
SET GLOBAL general_log_file='/var/log/mysql/mycustom.log';
@XVilka
XVilka / BiDiSupport.md
Last active May 14, 2024 12:10
BiDirectional Text

This gist will show the support of BiDirectional text in the terminal emulators and console programs. You can read more about the standardization efforts at the dedicated page of FreeDesktop Terminal BiDi working group.

How to test

Logical Order ◀ ◀ ◀ RTL LTR ▶ ▶ ▶
WHAT IS UNICODE؟ in arabic in arabic ؟EDOCINU SI TAHW ؟EDOCINU SI TAHW in arabic
ما هو الترميز الموحد يونيكود؟ in Arabic ما هو الترميز الموحد يونيكود؟ in Arabic