Skip to content

Instantly share code, notes, and snippets.

View moskva's full-sized avatar

Steven Suen moskva

View GitHub Profile
@moskva
moskva / mac-upgrade.sh
Created October 25, 2022 05:04 — forked from arturmartins/mac-upgrade.sh
How to keep your mac software updated easily (2022)
#!/bin/bash
# Requirements:
# - homebrew: https://brew.sh/
# - homebrew tap: buo/cask-upgrade - https://github.com/buo/homebrew-cask-upgrade
# - homebrew mas (Mac App Store command-line interface - https://github.com/mas-cli/mas)
# Update, upgrade all and cleanup
brew update && brew upgrade && brew cu --all --yes --cleanup && mas upgrade && brew cleanup
# Dump all taps, apps, casks and mac apps into ~/Brewfile
@moskva
moskva / Batch File Rename.scpt
Created December 12, 2019 10:10 — forked from oliveratgithub/Batch File Rename.scpt
Simple AppleScript to easily batch rename multiple files sequentially. GUI asks user to select files and input a name before renaming.
-- This code comes from https://gist.github.com/oliveratgithub/
-- Open in AppleScript Editor and save as Application
-- ------------------------------------------------------------
--this is required to break the filename into pieces (separate name and extension)
set text item delimiters to "."
tell application "Finder"
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list
display dialog "New file name:" default answer ""
set new_name to text returned of result
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file.
@moskva
moskva / iTerm2_Alfred_Script.txt
Last active June 21, 2019 07:07
iTerm2 3.0 for Alfred 4 Script
-- This script is from [iTerm2 - Alfred Support](https://www.iterm2.com/version3.html). I made some corrections.
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
\sclass="[a-zA-Z0-9:;\.\s\(\)\-\,]*"
Will match with the space before `class`:
hallo class="Guten" Tag
hallo class="Morgen">
@moskva
moskva / surge.conf
Created June 14, 2018 05:35 — forked from Zhiw/surge.conf
surge.conf for surge Reference https://gist.github.com/scomper/b0c6129840272c136a82(update frequenly)
[General]
# warning, notify, info, verbose
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10
dns-server = 114.114.114.114,119.29.29.29,8.8.8.8
[Proxy]
# http, https, socks5
# Shadowsocks 代理设置(TFO 需要服务器端程序及内核支持)
@moskva
moskva / Learn Blockchain Programming (8 Weeks).md
Created May 6, 2018 09:20
Learn blockchain programming in 8 weeks.
@moskva
moskva / ia-writer_marked.applescript
Created January 5, 2017 12:50 — forked from stephenhowells/ia-writer_marked.applescript
iA Writer AppleScript to preview text in Marked.
-- Preview the currently active iA Writer document using Marked.
tell application "iA Writer"
activate
-- Ask iA Writer for it's active document.
set the_document to document 1
-- Save the document or prompt if not previously saved.
save the_document
@moskva
moskva / FB_Ad_Terminology.md
Last active January 15, 2016 07:49
Facebook 的常见术语和缩略语

Facebook 广告投放的 5 个重要术语

转化像素 Conversion Pixel

转化像素是 Facebook 提供的一种工具,便于您在 Facebook 网络之外的其他网络平台上追踪广告成效。

动态消息 News Feed

动态消息是 Facebook 体验的核心。您的广告受众可在此找到他们关注的信息。动态消息是一个不断更新的列表,显示您的受众在 Facebook 所关注的用户和主页的动态。

@moskva
moskva / email_writing.md
Created January 8, 2016 03:01
email 中常用句子
  • Please let me know if I can provide you with any further assistance.