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.
\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 / 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 / free_email_provider_domains.txt
Created December 10, 2015 05:13 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com