Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from notion.client import NotionClient | |
import datetime | |
import os | |
from slugify import slugify | |
import re | |
import requests | |
import time | |
import hashlib | |
import shutil | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# jj-github-pr: Create Github PRs from jujutsu changes | |
# Each change will be one PR. Relations between changes will be preserved by setting the PR base branch. | |
# The commit title/message will be used for the PR title/body. | |
# The command can be used multiple times to update the stack of PRs, titles and commits. | |
# A "Relation chain" which shows the relation between the submitted PRs will be added to the PR body. | |
# Usage: Run jj-github-pr <revision> to submit each jj change as a PR. | |
# | |
# Example usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PSPDFThreadSafeMutableDictionary.m | |
// | |
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is |
做实验的时候常常会遇到一个脚本跑的很慢的情况,这个时候我们常常会想方设法的去做一些优化,来让脚本跑的快一些。 但是优化带来了两个问题,一个是优化后的代码仍然是正确的吗,第二个问题是优化有效果吗?
第一个问题可以依靠编写合适的单元测试来解决, 但是究竟如何编写合适的单元测试仍然是一个很大的问题,这个问题我们留待以后在讨论。
第二个问题可以依靠性能分析来解决,性能分析就是测试代码的执行时间,很多时候我们经常会用如下的方式来做性能分析,但是这种方法一来麻烦,二来会把代码弄得很混乱。
from time import time
begin_tick = time()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CloudContent] | |
"ConfigureWindowsSpotlight"=dword:00000002 | |
"IncludeEnterpriseSpotlight"=dword:00000000 | |
"DisableThirdPartySuggestions"=dword:00000001 | |
"DisableTailoredExperiencesWithDiagnosticData"=dword:00000001 | |
"DisableWindowsSpotlightFeatures"=dword:00000001 | |
"DisableWindowsSpotlightWindowsWelcomeExperience"=dword:00000001 | |
"DisableWindowsSpotlightOnActionCenter"=dword:00000001 |
Tired of spamming Yubikey one-time password (OTP) codes into Slack? Here are two options to help prevent that. You can do either or both. Both require ykman
, the Yubikey CLI configuration manager. Get it with Homebrew:
brew install ykman
If you…
- …don't have Homebrew? Install it, then run the command above
- …don't feel comfortable running terminal commands? Skip to the bottom
- …aren't sure what the big deal is? See "What's the big deal with Yubikey codes?" below
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "code": "aa", "name": "Afar" }, | |
{ "code": "ab", "name": "Abkhazian" }, | |
{ "code": "ae", "name": "Avestan" }, | |
{ "code": "af", "name": "Afrikaans" }, | |
{ "code": "ak", "name": "Akan" }, | |
{ "code": "am", "name": "Amharic" }, | |
{ "code": "an", "name": "Aragonese" }, | |
{ "code": "ar", "name": "Arabic" }, | |
{ "code": "as", "name": "Assamese" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COLUMNS=`tput cols` export COLUMNS # Get screen width. | |
WELCOME="WELCOME, DONATO" | |
VERSE="If you're worn out in this footrace with men, what makes you think you can race against horses?" | |
L_1=" ..,:cloddooddooooddoooddxxdolc:,... ..';coxxdo:,. ..',;:c:cllloooooooooooodddllc:,.. " | |
L_2=" .:loooloool;,'....';::ccc::;:cllclxkxdddooc:,. .:x00OOOkxddk000kd:. ..';clodkOkxxdoooool:::::;:;'';dkocc;:lx000ko, " | |
L_3=" 'dko;'...,ld; .,dkdl::,.. ,lc;:c:cox00Oxdoc,.. .dWWXo'.'.. ';:dO0O, ..;loddddolcoxo;. .. .:l::cc' .oKk;. .';:lk0k:." | |
L_4=" :XXc ..';cd: ;OO' .,;ccccccokkl:ldxooddooxO0OOOxo:'. ;OWO, .;'. .c:... .,codxxdl:,'',:lol'..;ccclc:cllcc:. .,ko. .,clc:,;:'. " | |
L_5=".dWk' 'll:;,',:cc, .,,..;c,. .''''.'''. .;ccoxkxxkkkkkO0KXX0xl;. oNXo,:0Oc'..c0l.,' .,:oxxxol:;;;coollll:. .',,,,,:xx;. .;' .c0kc::;:k0xlcc' " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let styles: [UIFont.TextStyle] = [ | |
// iOS 17 | |
.extraLargeTitle, .extraLargeTitle2, | |
// iOS 11 | |
.largeTitle, | |
// iOS 9 | |
.title1, .title2, .title3, .callout, | |
// iOS 7 | |
.headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
] |
NewerOlder