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
module.exports = async function (file, folder, tp) { | |
if (file.path(true) == "Untitled.md") { | |
let filename = await tp.system.prompt("Как назвать файл?", null, true); | |
filename = tp.user.sanitaze_filename(filename); | |
await tp.file.move(`${folder}/${filename}`); | |
return filename; | |
} | |
return file.title; | |
} |
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
var illegalRe = /[\/\?<>\\:\*\|"]/g; | |
var controlRe = /[\x00-\x1f\x80-\x9f]/g; | |
var reservedRe = /^\.+$/; | |
var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i; | |
var windowsTrailingRe = /[\. ]+$/; | |
function truncate(str, num) { | |
if (str.length > num) { | |
return str.slice(0, num) + "..."; | |
} else { |
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
// ==UserScript== | |
// @name Second timezone for Slack web client | |
// @namespace http://vanadium23.me/ | |
// @version 0.1 | |
// @description Add second time on element hover | |
// @author vanadium23 | |
// @match https://app.slack.com/client/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Pocket Counters | |
// @namespace http://vanadium23.me/ | |
// @version 0.5 | |
// @description Add counters to pocket list | |
// @author vanadium23 | |
// @match https://app.getpocket.com/* | |
// @ran-at document-idle | |
// @grant none | |
// ==/UserScript== |
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
# change some_device_name to according linux network device, e.g.: eth0 | |
# tc requires sudo for non-root user! | |
tc qdisc add dev some_device_name root handle 1: htb default 12 | |
tc class add dev some_device_name parent 1:1 classid 1:12 htb rate 1.6mbit ceil 1.6mbit | |
tc qdisc add dev some_device_name parent 1:12 netem delay 150ms |
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
# debug all requests | |
import requests | |
import logging | |
import http.client | |
http.client.HTTPConnection.debuglevel = 1 | |
logging.basicConfig() | |
logging.getLogger().setLevel(logging.DEBUG) | |
requests_log = logging.getLogger("requests.packages.urllib3") |
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 babel import Locale, UnknownLocaleError | |
def guess_lang_by_country(country): | |
try: | |
locale_string = 'und_{}'.format(country.upper()) | |
locale = Locale.parse(locale_string) | |
return locale.language | |
except (UnknownLocaleError, ValueError): | |
return None |
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
[alias] | |
# Shortening aliases | |
co = checkout | |
cob = checkout -b | |
f = fetch -p | |
c = commit | |
p = push | |
ba = branch -a | |
bd = branch -d | |
bD = branch -D |
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
Авторизация прошла успешно) | |
Теперь нажмите Enter в своём терминале, чтобы получить я мог сохранить Ваш access token. |