Skip to content

Instantly share code, notes, and snippets.

@GreyAsteroid
GreyAsteroid / StageManagerOptions.md
Last active April 2, 2024 11:53
Stage Manager Options

defaults write com.apple.WindowManager GloballyEnabled -bool [True/False] Adjusts whether Stage Manager is enabled or not.

defaults write com.apple.WindowManager AutoHide -bool [True/False] Adjusts auto hide behavior. This option controls the "Show Recent Apps" and "Hide Recent Apps" GUI option.

defaults write com.apple.WindowManager AutoHideOverlapThreshold -int [-2147483647...2147483647] Unsure what this option does. Should be noted that when AutoHide is set to False and this option is set to -17 or lower Stage Manager behaves as if AutoHide is set to True.

defaults write com.apple.WindowManager LeftStripMaximumRowCount -int [-2147483647...2147483647]

@qzm
qzm / aria2.conf
Last active April 27, 2024 04:59
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
@gvenzl
gvenzl / One Liner to download the latest release from your GitHub repo.md
Last active January 14, 2024 22:18
One Liner to download the latest release from your GitHub repo
LOCATION=$(curl -s https://api.github.com/repos/<YOUR ORGANIZTION>/<YOUR REPO>/releases/latest \
| grep "zipball_url" \
| awk '{ print $2 }' \
| sed 's/,$//'       \
| sed 's/"//g' )     \
; curl -L -o <OUTPUT FILE NAME> $LOCATION

for example:

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 17, 2024 12:44
set -e, -u, -o, -x pipefail explanation
@fuxingloh
fuxingloh / UILabelSize.swift
Last active March 29, 2024 07:26
iOS Swift: How to find text width, text height or size of UILabel.
extension UILabel {
func textWidth() -> CGFloat {
return UILabel.textWidth(label: self)
}
class func textWidth(label: UILabel) -> CGFloat {
return textWidth(label: label, text: label.text!)
}
class func textWidth(label: UILabel, text: String) -> CGFloat {
@Pulimet
Pulimet / AdbCommands
Last active May 15, 2024 20:41
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@utf
utf / Installing RVM Ruby Rails Passenger nginx on CentOS
Created August 11, 2012 00:32 — forked from fytzzz/Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
#Steps to install RVM + Ruby 1.9.3 + Rails + nginx + Passenger on CentOS (tested on v5.5)
# Todo get up to date repo's
# Install git and curl, if not already installed
sudo yum install git
sudo yum install curl-devel
# Create the rvm group and add any users who will be using rvm to the group
sudo su -
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 17, 2024 21:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bewebste
bewebste / backup_growl.rb
Created May 7, 2012 18:47
Script to display Time Machine progress messages as Growl notifications
#!/usr/bin/ruby
#Just run this script in a terminal window, leaving the window open in the
#background so it can continue to process messages.
IO.popen("syslog -F \'$(Sender): $Message\' -w -k Sender com.apple.backupd") { |syslogIO|
while (inputString = syslogIO.gets) do
escapedString = inputString.gsub("'", "\\'")
`/usr/local/bin/growlnotify -a 'Time Machine' -m '#{escapedString}'`
end
}