This file contains 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
[alias] | |
prune-gone = !git remote prune origin && git branch -v | grep gone | awk '{print $1}' | xargs git branch -D | |
recent = !git for-each-ref --sort='-authordate:iso8601' --format='%(authordate:relative)%09%(refname:short)' refs/heads | head -15 |
This file contains 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/local/opt/asdf/libexec/asdf.sh |
This file contains 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
jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --inplace --allow-errors --execute $1 |
This file contains 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
import { useContext } from "react" | |
/** | |
* A wrapper around `React.useContext` that throws an error if the context | |
* value is `undefined`, indicating that the component is not wrapped in the | |
* context provider. | |
* @param {React.Context} context | |
* @return {any} The context value. | |
*/ | |
export const useSafeContext = (context) => { |
This file contains 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
// npm install rewire | |
const rewire = require('rewire'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const defaults = rewire('react-scripts/scripts/build.js'); | |
const config = defaults.__get__('config'); | |
// Consolidate chunk files instead | |
config.optimization.splitChunks = { | |
cacheGroups: { | |
default: false, |
This file contains 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
cat /dev/clipboard | python -c 'import json, sys; json.dump(json.load(sys.stdin), sys.stdout, indent=4, sort_keys=True);' |
This file contains 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
rem Place this in C:\Python27\python2.bat | |
@echo off | |
set OLDPATH=%PATH% | |
path C:\Python27;%PATH% | |
python.exe %* | |
path %OLDPATH% |
This file contains 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 "Enter your password:"; read -s pass_str; sha1=$(echo -n $pass_str | tr -d '\n' | openssl sha1); echo "Hash prefix: ${sha1:0:5}"; echo "Hash suffix: ${sha1:5:35}"; result=$(curl https://api.pwnedpasswords.com/range/${sha1:0:5} 2>/dev/null | grep $(echo ${sha1:5:35} | tr '[:lower:]' '[:upper:]')); printf "Your password appeared %d times in the database.\\n" "${result#*:}" 2>/dev/null |
This file contains 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
create function dbo.IPAddressIsInRange(@ip as varchar(15), @range as varchar(18)) | |
returns bit | |
as | |
begin | |
declare @prefix varchar(15), | |
@cidr varchar(2), | |
@mask bigint | |
set @prefix = left(@range, charindex('/', @range) - 1) | |
set @cidr = right(@range, len(@range) - charindex('/', @range)) |
This file contains 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
; NOTE: This must be saved as UTF-8 BOM | |
emoji(text){ | |
If (A_EndChar = ":") { | |
SendInput %text% | |
} Else { | |
StringMid, s, A_ThisHotKey, 3 ; A_ThisHotKey contains 2 starting colons | |
SendRaw %s%%A_EndChar% | |
} | |
} |
NewerOlder