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 alter_theme() { | |
local current_hour=$(date +%H) | |
if [[ $current_hour -ge 7 && $current_hour -lt 18 ]]; then | |
base16_classic-light | |
else | |
base16_material-palenight | |
fi | |
} |
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
# fromhex A52A2A | |
# fromhex "#A52A2A" | |
# BLUE_VIOLET=$(fromhex "#8A2BE2") | |
# http://unix.stackexchange.com/a/269085/67282 | |
function fromhex() { | |
hex=$1 | |
if [[ $hex == "#"* ]]; then | |
hex=$(echo $1 | awk '{print substr($0,2)}') | |
fi | |
r=$(printf '0x%0.2s' "$hex") |
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
[difftool "webstorm"] | |
cmd = /Applications/WebStorm.app/Contents/MacOS/webstorm diff $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") | |
trustExitCode = true | |
[mergetool "webstorm"] | |
cmd = /Applications/WebStorm.app/Contents/MacOS/webstorm merge $(cd $(dirname \"$LOCAL\") && pwd)/$(basename \"$LOCAL\") $(cd $(dirname \"$REMOTE\") && pwd)/$(basename \"$REMOTE\") $(cd $(dirname \"$BASE\") && pwd)/$(basename \"$BASE\") $(cd $(dirname \"$MERGED\") && pwd)/$(basename \"$MERGED\") | |
trustExitCode = true | |
[merge] | |
keepBackup = false |
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 | |
rename_branch() { | |
[[ $# = 2 ]] && local from=$1 || local from=`git symbolic-ref -q --short HEAD` | |
local to=${2:-$1} | |
git branch -m $from $to | |
git push origin :$from $to | |
git push origin -u $to | |
} |
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
echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" |
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
// https://twitter.com/fermatslibrary/status/875340896379817984/photo/1 | |
const memoizedWords: { | |
[Key: string]: number; | |
} = {}; | |
const ALPHABET_MAPPED_TO_PRIME_NUMBERS: { | |
[Key: string]: number; | |
} = { | |
a: 2, | |
b: 3, |
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
const getPercentageRounds = function(percentage = 1) { | |
const blueSpotSymbol = "🔵"; | |
const emptySpotSymbol = "⚪"; | |
// 1 to 10 | |
const convertedPercent = Math.ceil(percentage * 10); | |
const blueSpots = Array(convertedPercent).fill(blueSpotSymbol); | |
const emptySpots = Array(10 - convertedPercent).fill(emptySpotSymbol); | |
return [...blueSpots, ...emptySpots].join(''); |
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
/** | |
* @include setTimeout(timeout) { | |
* properties to change to | |
* } | |
*/ | |
@use "sass:string"; | |
@mixin setTimeout($timeout) { | |
$animation-name: animation-#{string.unique_id()}; |
OlderNewer