This file contains hidden or 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
| import argparse | |
| import json | |
| import os | |
| import ssl | |
| import sys | |
| from pathlib import Path | |
| from urllib.error import HTTPError, URLError | |
| from urllib.parse import urlparse | |
| from urllib.request import Request, urlopen |
This file contains hidden or 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
| // Override created/updated field from request data | |
| onRecordBeforeCreateRequest((e) => { | |
| const requestData = $apis.requestInfo(e.httpContext) | |
| const overrideCreated = requestData.data['override_created'] | |
| const overrideUpdated = requestData.data['override_updated'] | |
| if (overrideCreated) { | |
| e.record.set('created', overrideCreated) |
This file contains hidden or 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
| // Move "SUN" to first day of week | |
| $('.calendar-week').children().last().prependTo('.calendar-week') | |
| let marginStep = 14.28; | |
| let config = { | |
| childList: true, | |
| subtree: true | |
| } | |
| let callback = (mutationList, observer) => { |
This file contains hidden or 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
| #Requires AutoHotkey v2.0 | |
| SWITCH_INPUT := 17 | |
| LAPTOP_INPUT := 15 | |
| SCALE_16_9_VALUE := 20 | |
| CODE_INPUT_SELECT := 60 | |
| CODE_SCALING := 86 | |
| CTRL_MON_EXE := "controlmymonitor.exe" |
This file contains hidden or 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
| import time | |
| from datetime import datetime | |
| import Adafruit_GPIO.SPI as SPI | |
| import Adafruit_SSD1306 | |
| from PIL import Image | |
| from PIL import ImageDraw | |
| from PIL import ImageFont |
This file contains hidden or 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
| function draw-box { | |
| param([string]$content) | |
| if ($content.length){ | |
| $content = "| $content |" | |
| $border = '+' + ('-' * ($content.length - 2)) + '+' | |
| echo $border | |
| echo $content | |
| echo $border -no | |
| } | |
| } |
This file contains hidden or 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
| import os, sys | |
| from os import listdir | |
| from os.path import isfile, join | |
| from pathlib import Path | |
| def must_get_dir_params(argv): | |
| video_dir = "" | |
| ass_dir = "" | |
| if len(argv) == 3: | |
| video_dir = argv[1] |
This file contains hidden or 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
| #member -in $args | |
| [CmdletBinding(PositionalBinding=$false)] | |
| param( | |
| [Parameter(Position=0)] | |
| [string]$Name, | |
| [switch]$Add, | |
| [switch]$List, | |
| [switch]$Help, | |
| [Parameter( | |
| ValueFromRemainingArguments = $true |
This file contains hidden or 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
| Add-Type -AssemblyName System.Windows.Forms | |
| $workingDirectory = 'D:\v_ram' | |
| $daysBeforeDelete = 3 | |
| $driveLetter = 'S:' | |
| $workFolder = 'current' | |
| $backupFolder = 'backup' | |
| $dateFormat = 'yyyy_MM_dd' |
This file contains hidden or 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
| import requests | |
| import time | |
| from bs4 import BeautifulSoup | |
| LOGIN_URL = "https://www.sunmobile.com.hk/cs/topup/login" | |
| DATA_USAGE_URL = "https://www.sunmobile.com.hk/cs/topup/value_add_servicePlan?datatime{}&mylocale=ch" | |
| class SunMobile: | |
| @staticmethod | |
| def login(number, password): |
NewerOlder