brew install cmus
git clone [email protected]:Arkq/cmusfm.git
cd cmusfm
require "string" | |
function checkBluetoothResult(rc, stderr, stderr) | |
if rc ~= 0 then | |
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout)) | |
end | |
end | |
function bluetooth(power) | |
print("Setting bluetooth to " .. power) |
cat <<EOF>~/.config/sublime-text-3/Packages/User/"Default (Linux).sublime-mousemap" | |
[ | |
// Change font size with ctrl+scroll wheel | |
{ "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" }, | |
{ "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" } | |
] | |
EOF |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
# On slow systems, checking the cached .zcompdump file to see if it must be | |
# regenerated adds a noticable delay to zsh startup. This little hack restricts | |
# it to once a day. It should be pasted into your own completion file. | |
# | |
# The globbing is a little complicated here: | |
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct. | |
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error) | |
# - '.' matches "regular files" | |
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours. | |
autoload -Uz compinit |
brew install cmus
git clone [email protected]:Arkq/cmusfm.git
cd cmusfm
Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.
cherry-pick
does support a range of commits, but if you have merge commits in that range, it gets really complicated
git checkout branch-B
git cherry-pick X
git cherry-pick Y
cfg.parser () { | |
fixed_file=$(cat $1 | sed 's/ = /=/g') # fix ' = ' to be '=' | |
IFS=$'\n' && ini=( $fixed_file ) # convert to line-array | |
ini=( ${ini[*]//;*/} ) # remove comments | |
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix | |
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1) | |
ini=( ${ini[*]/=/=\( } ) # convert item to array | |
ini=( ${ini[*]/%/ \)} ) # close array parenthesis | |
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2) | |
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis |
#!/bin/sh | |
# | |
# cmus-status-display | |
# | |
# Usage: | |
# in cmus command ":set status_display_program=cmus-status-display" | |
# | |
# This scripts is executed by cmus when status changes: | |
# cmus-status-display key1 val1 key2 val2 ... | |
# |
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
# IIS functions | |
Import-Module WebAdministration | |
function Test-WebAppPool($Name) { | |
return Test-Path "IIS:\AppPools\$Name" | |
} | |
function Get-WebAppPool($Name) { |