This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TestCopy() | |
{ | |
BOOL cond = FALSE; | |
IFileOperation *FileOperation1 = NULL; | |
IShellItem *isrc = NULL, *idst = NULL; | |
BIND_OPTS3 bop; | |
SHELLEXECUTEINFOW shexec; | |
HRESULT r; | |
do { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void **find_sys_call_table(void *kernel_addr, int kernel_size) | |
{ | |
/* | |
Check for the system_call_fastpath() signature, hand-written piece of | |
assembly code from arch/x86/kernel/entry_64.S: | |
ja badsys | |
mov rcx, r10 | |
call sys_call_table[rax * 8] | |
mov [rsp + 20h], rax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
on convertListToString(theList, theDelimiter) | |
set output to (item 1 of theList) | |
if (count theList) > 1 then | |
set theList to items 2 through (count theList) of theList | |
repeat with listItem in theList | |
set parsedItem to listItem | |
if space is in listItem then | |
set parsedItem to (quoted form of listItem) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Emulate scrolling by sending up and down keys if these commands are running in the pane | |
tmux_commands_with_legacy_scroll="'nano less more man'" | |
bind -n WheelUpPane if "[[ #{tmux_commands_with_legacy_scroll} =~ #{pane_current_command} ]]" "select-pane -t = ; send-keys Up" 'if-shell -F -t = "#{mouse_any_flag} || #{pane_in_mode}" "send-keys -M" "copy-mode -et="' | |
bind -n WheelDownPane if "[[ #{tmux_commands_with_legacy_scroll} =~ #{pane_current_command} ]]" "select-pane -t = ; send-keys Down" 'if-shell -F -t = "#{mouse_any_flag} || #{pane_in_mode}" "send-keys -M" "copy-mode -et="' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEVELOPER_DIR=$(XCODE_VER=9; TMP_RET=$(ls "/Applications" | grep -E "Xcode-?${XCODE_VER}.*\.app" | head -n 1 | xargs -I {} echo "/Applications/{}/Contents/Developer"); [[ ${TMP_RET} ]] || TMP_RET=$(/usr/bin/xcrun xcode-select -p); echo $TMP_RET) eval echo '$DEVELOPER_DIR' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Collection { | |
/// Returns the element at the specified index iff it is within bounds, otherwise nil. | |
subscript (safe index: Index) -> Element? { | |
return indices.contains(index) ? self[index] : nil | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd /usr/local/Homebrew | |
# brew update && git stash pop | |
# BREW_PINNED=$(brew list --pinned | sort | tr '\n' ' ') sh -c '_cleanup() { brew cleanup && brew cask cleanup && brew pin $BREW_PINNED; }; trap _cleanup INT; echo "Pinned: $BREW_PINNED"; brew unpin $BREW_PINNED; brew upgrade; _cleanup' | |
#OR | |
(BREW_PINNED=($(brew list --pinned | sort | tr '\n' ' ')); function _cleanup() { brew cleanup && brew cask cleanup; brew pin "$BREW_PINNED[@]"; }; trap _cleanup INT; echo "Pinned: $BREW_PINNED"; brew unpin "$BREW_PINNED[@]"; brew upgrade; _cleanup) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSLog(@"RC: %ld", CFGetRetainCount((__bridge CFTypeRef)m_object)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
readonly LOG_FILE="/tmp/$(basename "$0").log" | |
log_i() { echo "[INFO] $*" | tee -a "$LOG_FILE" >&2; } | |
log_w() { echo "[WARNING] $*" | tee -a "$LOG_FILE" >&2; } | |
log_e() { echo "[ERROR] $*" | tee -a "$LOG_FILE" >&2; } | |
log_f() { echo "[FATAL] $*" | tee -a "$LOG_FILE" >&2; return 1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local -r SAVED_OPTIONS=$(set +o) | |
source "script_that_modifies_shell_options.sh" | |
set +x; eval "${SAVED_OPTIONS}" |