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 | |
echo "Updating Files" | |
FILE_LIST=`find . -type f | grep -E "\.(rs|ts|tsx)$" | grep -v node_modules | grep -v target` | |
REPLACEMENTS_LIST=("s/Equipment/AssetItem/g s/equipment/asset_item/g" ) | |
echo "Replacing:" | |
for REPLACEMENT in ${REPLACEMENTS_LIST[@]} | |
do | |
echo $REPLACEMENT | |
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
# Find all cargo.toml in folders linked from current directory and run cargo clean in each one directories | |
find . -name Cargo.toml -execdir cargo clean \; |
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 | |
echo "Updating Files" | |
FILE_LIST=`find . -type f | grep -E "\.(rs|ts|tsx)$"` #Choose your prefered file types here | |
REPLACEMENTS_LIST=("s/Example/TitlecaseReplacement/g" "s/example/snake_case_relacement/g") #Add more replacements here as desire | |
echo "Replacing:" | |
for REPLACEMENT in ${REPLACEMENTS_LIST[@]} | |
do | |
echo $REPLACEMENT | |
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
package main | |
//Matt Parkers Math Puzzles number 19 | |
//Find an integer N for which the the sum of the squares of the first N primes is divisible by N and N is greater than 19 | |
func main() { | |
//Shamelessly use a precalculated list of 38 primes | |
primes := [38]int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163} | |
sumOfSquares := 0 |
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 | |
cd $GIT_REPO | |
if [[ `git status --porcelain` ]] | |
then | |
# changes | |
git add . | |
git commit -m "Auto Git Commit for `date`" | |
git push origin master | |
fi |