Skip to content

Instantly share code, notes, and snippets.

Avatar

tenhow

View GitHub Profile
@jonathantneal
jonathantneal / recovery.sh
Last active Nov 26, 2020
Create or update macOS Mojave Recovery Partition Without Reinstalling
View recovery.sh
#!/bin/sh
# Set the macOS installer path as a variable
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport"
echo "macOS installer is \"$MACOS_INSTALLER\""
# Set the target disk as a variable
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//')
echo "Target disk is \"$TARGET\""
@yeutterg
yeutterg / Mac Chrome Application Shortcuts 2018-06.txt
Last active Oct 6, 2020
How to enable Application Shortcuts on Chrome for Mac, as of June 2018
View Mac Chrome Application Shortcuts 2018-06.txt
How to get "Application Shortcut" functionality on Chrome for Mac, as of January 2020:
1. Visit the web page you would like to turn into an application
2. Navigate to Settings > More Tools > Create Shortcut...
3. Give the app a name, make sure "Open as window" is enabled, and click Create
4. The folder Chrome Apps should open in finder. Drag the new app shortcut to the dock or another location for easy access
That's it! You can even quit the app (Cmd-Q) without closing other Chrome windows, as it acts like a separate Mac app.
@jaywilliams
jaywilliams / install-mosh.sh
Last active Oct 28, 2020 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2018)
View install-mosh.sh
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.3.2
# Create Source Directory
mkdir -p $PREFIX/src
View ReorderingRealmResultsInTableView.swift
import UIKit
import RealmSwift
class Data: Object {
dynamic var name = ""
...
dynamic var order = 0 // 並べ替えのためのカラムが必要
}
@mamiu
mamiu / install_fish_debian.sh
Last active Nov 24, 2018
Install fish shell in Debian 8 (commands from the original fish shell website).
View install_fish_debian.sh
#!/bin/bash
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /' >> /etc/apt/sources.list.d/fish.list
apt-get update
wget -qO - http://download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key | apt-key add -
apt-get update
apt-get install -y fish
@mdwheele
mdwheele / yosemite-sound-issues.md
Created Oct 22, 2014
Fix Yosemite Bluetooth Sound Issues
View yosemite-sound-issues.md
  1. Run the following in your terminal.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created Oct 3, 2014
install chrome from powershell
View gist:350fe1713591641b3b42
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@yxjxx
yxjxx / luna_pinyin_simp.custom.yaml
Last active Sep 12, 2018
ibus-rime模糊音:新增文件 luna_pinyin_simp.custom.yaml
View luna_pinyin_simp.custom.yaml
# luna_pinyin_simp.custom.yaml
#
# 【朙月拼音】模糊音定製模板
# 佛振配製 :-)
# Modify by yxjxx
#
# 位置:
# ~/.config/ibus/rime (Linux)
# ~/Library/Rime (Mac OS)
# %APPDATA%\Rime (Windows)
@steipete
steipete / PSPDFThreadSafeMutableDictionary.m
Last active Apr 16, 2020
Simple implementation of a thread safe mutable dictionary. In most cases, you want NSCache instead, but it can be useful in situations where you want to manually control what is evicted from the cache in low memory situations.**Warning:** I only use this for setting/getting keys. Enumeration is not thread safe here and will still throw exception…
View PSPDFThreadSafeMutableDictionary.m
//
// PSPDFThreadSafeMutableDictionary.m
//
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
View luna_pinyin.custom.yaml
# luna_pinyin.custom.yaml
# 修改字典名爲 luna_pinyin.kunki
# 其對應的用戶詞典名取句點之前部分即 luna_pinyin
patch:
translator/dictionary: luna_pinyin.kunki
You can’t perform that action at this time.