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
function stress_cpu() { | |
for I in `seq 1 $(getconf _NPROCESSORS_ONLN)` | |
do | |
yes > /dev/null & | |
done | |
echo "Press enter to stop" | |
read | |
killall yes | |
} |
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
# from https://github.com/sindresorhus/quick-look-plugins | |
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json betterzip suspicious-package | |
echo "open BetterZip to activate ql plugin" |
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
val1="" | |
val2="asd" | |
function firstDefinedName() { | |
for varName in "$@"; do | |
if [[ ! -z "${!varName+____}" ]]; then | |
echo "$varName" | |
break | |
fi | |
done |
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
# map helpers | |
hput() { | |
eval "$1""$2"='$3'; | |
} | |
hget() { | |
eval echo '${'"$1$2"'#hash}'; | |
} | |
# bulk set |
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
# check dependencies | |
command -v brew >/dev/null 2>&1 || { echo >&2 "brew is not installed, aborting"; exit 1; } | |
command -v git >/dev/null 2>&1 || { echo >&2 "git is not installed, aborting"; exit 1; } | |
# install oh-my-zsh without entering it | |
curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sed -e "s/env zsh -l/echo ---/g" | sh | |
# clone powerlelvel9k theme | |
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k | |
# set zsh theme | |
sed -i '' -e 's/ZSH_THEME=".*"/ZSH_THEME="powerlevel9k\/powerlevel9k"/g' ~/.zshrc | |
# turn off brew auto apdates for this session |
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
#! /bin/bash | |
# ----- UTILS ------ | |
# get device id by it's name 'SomeDiskName' -> '/dev/disk3' | |
get_device() { | |
local target=$1 | |
[[ -z $target ]] && { return; } | |
local line=$(diskutil list | grep $target) | |
local disk=$(echo "$line" | sed 's/.*\(disk[0-9]*\).*/\1/' | sed -n 1p) |
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
sudo apt-get update && \ | |
sudo apt-get install -y git git-core curl zsh nano && \ | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" && \ | |
sed -i -E 's/ZSH_THEME=".+"/\[\[ \-n \$SSH_CONNECTION \]\] \&\& ZSH_THEME\="bira" \|\| ZSH_THEME\="af\-magic"/g' $HOME/.zshrc && \ | |
env zsh |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Windows.Forms; | |
namespace CountersListPreview | |
{ | |
internal static class CounterPreview |
NewerOlder