Skip to content

Instantly share code, notes, and snippets.

View michael-yx-wu's full-sized avatar

Michael Wu michael-yx-wu

View GitHub Profile
@michael-yx-wu
michael-yx-wu / buildincrement.sh
Created May 28, 2014 06:00
Xcode - Increment Build Number on Archive
#!/bin/bash
if [ $CONFIGURATION == Release ]; then
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
# increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
[
{ "keys": ["ctrl+tab"], "command": "next_view"},
{ "keys": ["ctrl+shift+tab"], "command": "prev_view"},
{ "keys": ["ctrl+shift+]"], "command": "next_view"},
{ "keys": ["ctrl+shift+["], "command": "prev_view"},
{ "keys": ["ctrl+i"], "command": "reindent"},
{ "keys": ["enter"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)\"'\\]\\};]", "match_all": true },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false }
#!/bin/bash
if [ `defaults read -g ApplePressAndHoldEnabled` -eq 1 ]; then
defaults write -g ApplePressAndHoldEnabled -bool false
echo "Disabled press and hold"
else
defaults write -g ApplePressAndHoldEnabled -bool true
echo "Enabled press and hold"
fi
Atom Settings
@michael-yx-wu
michael-yx-wu / docker-shrink
Last active July 26, 2016 21:15
Until Docker native can automatically do this, use this script to reclaim free space from your Docker.qcow2 file.
#!/usr/bin/env bash
set -e
set -o pipefail
function qcow2_size() {
wc -c Docker.qcow2 | awk '{print $1}'
}
cd ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux
@michael-yx-wu
michael-yx-wu / draft.ts
Created December 5, 2016 17:08
Blueprint Table Loading Options
// column.ts
export type ColumnLoadingOptions = "cell"
| "column-header"
export const ColumnLoadingOptions = {
CELL: "cell" as ColumnLoadingOptions,
COLUMN_HEADER: "column-header" as ColumnLoadingOptions,
};
export interface IColumnProps extends IColumnNameProps, IProps {
...
@michael-yx-wu
michael-yx-wu / list.sh
Last active October 5, 2017 11:34
List brew packages and things that use them
brew list -1 | while read cask; do
echo -ne "\x1B[1;34m $cask \x1B[0m"
brew uses $cask --installed | awk '{printf(" %s ", $0)}'
echo ""
done
@michael-yx-wu
michael-yx-wu / setup.md
Last active September 8, 2020 16:23
Factorio server setup (Ubuntu)

As root, update the server's installed packages:

> apt-get update
> apt-get upgrade -y

Set default editor (vim):

> update-alternatives --config editor