Skip to content

Instantly share code, notes, and snippets.

@NSBum
NSBum / wiki_code_russian_content.py
Created December 20, 2023 21:59
Get wiki code of ru.wikitionary.org entry but only Russian language.
import re
import requests
def get_wiktionary_russian_content(word):
url = "https://ru.wiktionary.org/w/api.php"
params = {
"action": "query",
"format": "json",
"titles": word,
"prop": "revisions",
@NSBum
NSBum / WD_My_Cloud_EX2.txt
Created April 19, 2023 10:48 — forked from diffficult/WD_My_Cloud_EX2.txt
Fan control notes for WD My Cloud EX2 Ultra
~ # fan_control -?
*** Fan Cobtrol Help Message ***
fan_control b c: for NAS booting
fan_control 0 d : [auto: low/medium/high/max] open debug msg
fan_control 0 c : [auto: low/medium/high/max] close debug msg
fan_control -L [value] : set Lower (THYST)
fan_control -H [value] : set Upper(TOS)
fan_control -g 0 : get current temperature
fan_control -g 1 : get Lower temperature
fan_control -g 2 : get Upper temperature
@NSBum
NSBum / anki.html
Created April 20, 2022 11:45
anki tts snippet
<!-- if there's no alternate pronunciation, play the TTS default -->
{{^alt_pronunciation_2}}
{{tts ru_RU voices=AwesomeTTS:sentence_ru_pf}}
{{/alt_pronunciation_2}}
<!-- if an alternate pronunciation is provided, then play it -->
{{#alt_pronunciation_2}}
{{alt_pronunciation_2}}
{{/alt_pronunciation_2}}
@NSBum
NSBum / check_mlhu_vaccine.py
Last active April 7, 2021 10:38
MHLU vaccine notifier
#!/usr/bin/env python3
try:
# Python 2
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen, Request
from lxml import etree
import re
from py_imessage import imessage
@NSBum
NSBum / KjellinSentences.txt
Created July 13, 2020 14:43
Generate six iterations of the track content + 650 ms silence
SelEnd:
Select:End="-0.65" Mode="Set" RelativeTo="SelectionEnd" Start="0"
Silence:Use_Preset="User Preset:650ms"
SelectAll:
CursSelEnd:
Repeat:Count="5"
@NSBum
NSBum / CompressAndTruncate.txt
Created July 13, 2020 14:31
Audacity macro to trim silence and compress dynamic range
SelectAll:
TruncateSilence:Action="Truncate Detected Silence" Compress="50" Independent="0" Minimum="0.5" Threshold="-20" Truncate="0.5"
Compressor:AttackTime="0.2" NoiseFloor="-40" Normalize="1" Ratio="2" ReleaseTime="1" Threshold="-12" UsePeak="0"
@NSBum
NSBum / df
Created March 11, 2020 17:59
External note editor error log
Syncing failed:
Traceback (most recent call last):
File "aqt/sync.py", line 376, in _sync
File "aqt/sync.py", line 356, in _abortingSync
File "anki/sync.py", line 44, in sync
File "anki/sync.py", line 592, in meta
File "anki/sync.py", line 556, in req
File "anki/sync.py", line 441, in post
File "requests/sessions.py", line 572, in post
File "requests/sessions.py", line 510, in request
@NSBum
NSBum / foldergallery.html
Last active January 18, 2020 11:20
Adaptation of this fancybox-based folder gallery: https://greekdeveloper.com/2018/folder-based-gallery-for-hugo/
<!-- /layouts/shortcodes/foldergallery.html -->
<style>
div.gallery {
display: flex;
flex-wrap: wrap;
}
div.gallery a {
flex-grow: 1;
@NSBum
NSBum / 4bit7segment.ino
Created April 16, 2018 19:18
4 bits 7 segment with shift registers
unsigned char LED_0F[] =
{// 0 1 2 3 4 5 6 7 8 9 A b C d E F -
0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x8C,0xBF,0xC6,0xA1,0x86,0xFF,0xbf
};
unsigned char LED[4]; //用于LED的4位显示缓存
int SCLK = 2;
int RCLK = 1;
int DIO = 0; //这里定义了那三个脚
void setup ()
{
@NSBum
NSBum / RF24_Button_Relay_test.cpp
Created March 29, 2018 21:40
Trigger relay remotely using nRF24L01+ modules
#include <SPI.h>
#include "RF24.h"
#include <EEPROM.h>
/* Hardware connections from Arduino Nano to nRF24L01
* CE -> D9
* CSN -> D10
* SCK -> D13
* MOSI -> D11
* MISO -> D12