- Install plugin
Custom CSS and JS Loader
- Open
setting.json
add lines below"vscode_custom_css.imports": ["file:///Users/Don/Documents/vscode/customtheme/vscode-vibrancy.css", "file:///Users/Don/Documents/vscode/customtheme/vscode-vibrancy.js"], "vscode_custom_css.policy": true, "terminal.integrated.rendererType": "dom"
- CMD + Shift + p, reload custom css and js
- Restart VSCode
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 Foundation | |
/** | |
Set FourCharCode/OSType using a String. | |
Examples: | |
let test: FourCharCode = "420v" | |
let test2 = FourCharCode("420f") | |
print(test.string, test2.string) | |
*/ |
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
func getSystemUUID() -> String? { | |
let dev = IOServiceMatching("IOPlatformExpertDevice") | |
let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev) | |
let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey as CFString, kCFAllocatorDefault, 0) | |
IOObjectRelease(platformExpert) | |
guard let ser: CFTypeRef = serialNumberAsCFString?.takeUnretainedValue() else { return nil } | |
if let result = ser as? String { | |
return result |
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
# got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles | |
ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=chi outfile.mp4 | |
# confirmed working with the following ffmpeg | |
# (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` ) | |
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers | |
built with Apple clang version 12.0.0 (clang-1200.0.32.2) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libx |
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
//HC-SR04+ | |
const int trigpin = D4; | |
const int echopin = D3; | |
long duration; | |
int distance; | |
void setup(){ | |
pinMode(trigpin,OUTPUT); | |
pinMode(echopin,INPUT); | |
Serial.begin(115200); |
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
#define BUZZER D6 | |
#define LIGHTD D11 | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("setup"); | |
pinMode(BUZZER, OUTPUT); | |
digitalWrite(BUZZER, HIGH); |
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
#define BUZZER D6 | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("setup"); | |
pinMode(BUZZER, OUTPUT); | |
digitalWrite(BUZZER,HIGH); | |
} |
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 Foundation | |
let names = ["Dong", "Chris", "Alex", "Ewa", "Barry", "Baniella"] | |
// 1.Origin | |
func forward(_ s1: String, _ s2: String) -> Bool { return s1 < s2 } | |
var orderNames = names.sorted(by: forward) | |
// 2.Closure writen as entired format | |
var reverseNames = names.sorted (by: { (s1: String, s2: String) -> Bool in |
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
enum Rank: Int, CustomStringConvertible { | |
case ace = 1 | |
case two, three, four, five, six, seven, eight, nine, ten | |
case jack, queen, king | |
func simpleDescription() -> String { | |
switch self { | |
case .ace: | |
return "ace" | |
case .jack: |
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
#!/usr/bin/env python3 | |
# -*- coding: utf8 -*- | |
if __name__ == "__main__": | |
import glob, os, datetime, fileinput | |
cwd = os.getcwd() | |
files = [f for f in glob.glob(cwd + os.path.sep + "**/*.rst", recursive=True)] | |
for f in files: | |
modifieddate = datetime.datetime.fromtimestamp(os.path.getmtime(f)) | |
if not ':date:' in open(f).read(): |
NewerOlder