Skip to content

Instantly share code, notes, and snippets.

@gjreasoner
gjreasoner / README.md
Last active April 25, 2024 01:42
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part
@waylybaye
waylybaye / index.js
Last active March 10, 2022 11:09
Send Notification using Telegram when new IAP is purchased
const functions = require('firebase-functions');
const TelegramBot = require('node-telegram-bot-api');
const token = "***"
const chatID = 1024 // your telegram id, you must first send a message to your bot
exports.notifyIAP = functions.analytics.event('in_app_purchase').onLog((event) => {
const purchaseValue = event.valueInUSD;
if (purchaseValue > 0) {
const bot = new TelegramBot(token, {polling: false});
@Dobby233Liu
Dobby233Liu / xiaoxiao_tts.py
Last active May 30, 2023 07:05 — forked from xjohjrdy/xiaoxiao_tts.py
superb edit of an old parameterless script
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Edge Microsoft TTS for Python."""
import sys
from ws4py.client.threadedclient import WebSocketClient
import binascii
import argparse
import json
import requests
import re
@xjohjrdy
xjohjrdy / xiaoxiao_tts.py
Last active April 24, 2024 09:27
返回的音频没有文件头,所以我随便加的一个文件头,但显示的音频时长有问题。如果播放器不能正常播放,可以使用Chrome播放。
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
from ws4py.client.threadedclient import WebSocketClient
import binascii
class WSClient(WebSocketClient):
def __init__(self, url, text, filename):
@markus2120
markus2120 / zt_VPN.md
Last active January 17, 2023 05:51
Route all traffic with a raspberry pi like a VPN
@acamino
acamino / README.md
Last active July 21, 2024 06:20
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U — (bash) Clear the characters on the line before the current cursor position
  • CTRL + U —(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
#!/usr/bin/python
# We send candy shipments in batches in 2 week intervals. Each list here shows which customers received
# each batch, starting from Nov 28th 2015. When a number goes missing, it means that the customer canceled
# their subscription. When a number appears, it means that a new customer joined.
shipping_lists = [
[1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 19, 21, 22, 24, 26, 27, 30, 31, 33, 34, 36, 37, 40, 42, 45, 46, 49, 50, 51, 52, 56, 57, 58, 59, 61, 64, 66, 67, 68, 70, 71, 72, 73, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 88, 89, 93, 94, 95, 96, 98, 99, 101, 103, 104, 105, 106, 109, 110, 111, 112, 118, 122, 124, 125, 127, 129, 130, 131, 132, 134, 135, 137, 140, 141, 142, 143, 145, 146, 149, 150, 152, 153, 154, 156, 158, 160, 163, 164, 166, 167, 168, 169, 170, 171, 173, 175, 177, 179, 180, 182, 184, 187, 188, 189, 190, 191, 192, 193, 196, 197, 198, 200, 201, 203, 205, 206, 207, 208, 209, 210, 211, 213, 215, 216, 218, 219, 220, 223, 224, 225, 226, 227, 228, 229, 230, 232, 236, 237,
@steipete
steipete / Macros.h
Last active January 6, 2024 07:24
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in https://developer.apple.com/library/ios/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObj…
#ifndef NS_DESIGNATED_INITIALIZER
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
#else
#define NS_DESIGNATED_INITIALIZER
#endif
#endif
@rmangino
rmangino / gist:8388849
Created January 12, 2014 18:57
Disable the automatic muting of system audio during Dictation under OS X 10.9 (Mavericks)
defaults write com.apple.SpeechRecognitionCore AllowAudioDucking -bool NO
defaults write com.apple.speech.recognition.AppleSpeechRecognition.prefs DictationIMAllowAudioDucking -bool NO
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.