Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Frad LEE FradSer

🎯
Focusing
Block or report user

Report or block FradSer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SwiftUI Challenge - C01B02.swift
func timeString(time: Double) -> String {
return String(format: "%.1f", time)
}
View SwiftUI Challenge - C01B03.swift
Text(timeString(time: timeCount))
.onAppear(perform: {
let _ = self.timer
})
View SwiftUI Challenge - C01B01.swift
@State var timeCount: Double = 0.0
var timer: Timer {
Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) {timer in
self.timeCount += 0.1
}
}
View SketchSystems.spec
Nippon Colors Game
is color hited -> Color Display
Color Mixer
Color Display
is color changed -> Color Mixer
@FradSer
FradSer / iterm2_switch_automatic.md
Last active May 3, 2019
Switch iTerm2 color preset automatic base on macOS dark mode.
View iterm2_switch_automatic.md
  1. Download iTerm2 nightly build from here.

  2. Add switch_automatic.py to ~/Library/Application Support/iTerm2/Scripts/ with:

 #!/usr/bin/env python3

import asyncio
import iterm2
View .aliases.backup
#!/usr/bin/env bash
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
View keybase.md

Keybase proof

I hereby claim:

  • I am FradSer on github.
  • I am fradser (https://keybase.io/fradser) on keybase.
  • I have a public key whose fingerprint is 4420 5D82 FDD0 B496 4632 83A5 EC90 3317 4BAB AF4A

To claim this, I am signing this object:

@FradSer
FradSer / surge.sh
Created Mar 11, 2016
Surge for Mac 的相关 function,实现快速添加规则,快速配置适合 Surge for Mac 的网络配置,以及还原网络配置。
View surge.sh
# Surge for Mac. Portnumber is 6152.
function surge_add() {
if [ "$1" == "--proxy" -o "$1" == "-p" -o "$1" == "--direct" -o "$1" == "-d" ]; then
if [ "$(cat ~/.surge.conf | grep -c $2)" -eq 0 ]; then
if [ "$1" == "--proxy" -o "$1" == "-p" ]; then
sed -i '' -e '539i \
DOMAIN-SUFFIX,'$2',Proxy' ~/.surge.conf;
fi;
if [ "$1" == "--direct" -o "$1" == "-d" ]; then
sed -i '' -e '539i \
View surge_add.sh
# Surge for Mac
function surge_add() {
if [ "$1" == "--proxy" -o "$1" == "-p" -o "$1" == "--direct" -o "$1" == "-d" ]; then
if [ "$(cat ~/.surge.conf | grep -c $2)" -eq 0 ]; then
if [ "$1" == "--proxy" -o "$1" == "-p" ]; then
sed -i '' -e '541i \
DOMAIN-SUFFIX,'$2',Proxy' ~/.surge.conf;
fi;
if [ "$1" == "--direct" -o "$1" == "-d" ]; then
sed -i '' -e '541i \
You can’t perform that action at this time.