brew install rbenv ruby-build
rbenv init # Or add eval "$(rbenv init - zsh)" to rc file
rbenv install 2.7.2
echo 2.7.2 > .ruby-version
gem inst ffi -- --disable-system-libffi
bundle install
bundle exec jekyll serve
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
let allVoices = AVSpeechSynthesisVoice.speechVoices().filter { theVoice in | |
theVoice.language.contains("zh") | |
} | |
for idx in allVoices.indices { | |
let theVoice = allVoices[idx] | |
let lang = theVoice.language | |
let gender: String | |
if theVoice.gender == .male { | |
gender = "male" |
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
// | |
// InfiniteScrollChart.swift | |
// ChartsGallery | |
// | |
// Created by beader on 2022/11/3. | |
// | |
import SwiftUI | |
import Charts |
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
import UIKit | |
struct ChineseTransliterator { | |
static func transliterate(text: String, sourceView: UIView) { | |
let textView = UITextView() | |
textView.isHidden = true | |
textView.text = text | |
textView.selectAll(nil) | |
sourceView.addSubview(textView) |
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
/* | |
See LICENSE folder for this sample’s licensing information. | |
Abstract: | |
The `MusicPlayerManager` manages the media playback using the `MPMusicPlayerController` APIs. | |
*/ | |
import UIKit | |
import MediaPlayer |
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
# TAGS speparated by vertical line | | |
OPTIMIZE_TAGS="OPTIMIZE:|TEST:" | |
find "${SRCROOT}/" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($OPTIMIZE_TAGS).*\$" | wc -l | xargs -I{} echo "warning: 🔆 {} Optimize | Test Items" | |
NEXTUP_TAGS="NEXTUP:" | |
find "${SRCROOT}/" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($NEXTUP_TAGS).*\$" | wc -l | xargs -I{} echo "warning: 🗃️ {} NextUp Tasks" | |
FIXME_TAGS="FIXME:" |
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
@import Photos; | |
[PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) { | |
NSLog(@"PHAuthorizationStatus: %ld", status); | |
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init]; | |
fetchOptions.includeHiddenAssets = YES; | |
fetchOptions.includeAllBurstAssets = YES; | |
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions]; |
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
import Foundation | |
import UIKit | |
struct DropShadowStyle { | |
var color: UIColor = .black | |
var alpha: Float = 0.1 | |
let x: CGFloat | |
let y: CGFloat | |
let blur: CGFloat | |
let spread: CGFloat |
python -m venv .venv
source .venv/bin/activate
pip install m3u8downloader
downloadm3u8 -o foo.mp4 spaces_m3u8_url
ffmpeg -i foo.mp4 -b:a 192K -vn bar.mp3
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
console.log('Select Layer Then Run Script.'); | |
var sketch = require('sketch'); | |
var UI = require('sketch/ui'); | |
var document = sketch.getSelectedDocument(); | |
var selectedLayers = document.selectedLayers; | |
var selectedCount = selectedLayers.length; |