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
#!/bin/bash | |
#Find matching text in all files | |
find . -type f -name "*.rb" | while read file; do found=$(sed -n 's/config//p' "$file"); if [ ! -z "$found" ]; then echo "$file"; fi; done; |
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
#!/bin/bash | |
#Find and replace all files with ^M (dos format) to Unix format. | |
find $(pwd) -type f -name "*.php" | while read file; do sed -e 's/^M//g' -i "$file"; done; |
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
#!/bin/bash | |
search="s/$@//p" | |
find . -type f -name '*.js' | while read file; do found=$(sed -n "$search" "$file"); if [ ! -z "$found" ]; then echo "$file"; fi; done; |
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
cwd=`pwd`;cd /usr/local; curl -s https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.gz | sudo tar --strip-components 1 -xz && cd "$cwd" |
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/bin/env bash | |
currentBranch="`git branch | while read line; do if [[ "$line" =~ ^\* ]]; then echo ${line:2}; fi; done`" | |
if [ -d docs ]; then | |
rm -rf docs | |
fi | |
./node_modules/.bin/jsdoc -c jsdoc.json | |
git stash | |
git checkout gh-pages | |
mv -f ./docs/*.html . | |
rm -rf docs |
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
'use strict'; | |
let v8 = require('v8'); | |
let start = Date.now(); | |
let fieldMap = {}; | |
let amount = 2E5; | |
let cycles = 4; | |
for (let c = 0; c < cycles; c++) { | |
fieldMap['a_'+c] = 'a'+c; | |
fieldMap['b_'+c] = 'b_'+c; | |
fieldMap['c_'+c] = 'c'+c; |
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
'use strict'; | |
let v8 = require('v8'); | |
let start = Date.now(); | |
let fieldMap = {}; | |
let amount = 2E5; | |
let cycles = 4; | |
for (let c = 0; c < cycles; c++) { | |
fieldMap['a_'+c] = 'a'+c; | |
fieldMap['b_'+c] = 'b_'+c; | |
fieldMap['c_'+c] = 'c'+c; |
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/bin/env bash | |
#load vim session | |
session=$1 | |
loadVimSession() { | |
echo | |
vim -S $HOME/.vim/sessions/$session | |
} | |
findVimSession() { | |
session=`ls ~/.vim/sessions | sed "${1}q;d"` | |
if [ -z "$session" ]; then |
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
#!/bin/bash | |
grep -R console.log --exclude-dir node_modules --exclude-dir .git --exclude *.md . |
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/bin/env bash | |
containerName=''; | |
truncateDockerLog(){ | |
truncate -s 0 $(docker inspect $containerName | grep log | awk '{print $2}' | cut -d\" -f2) | |
} | |
# pass no args and truncate all | |
# pass a container name and truncate that container |
OlderNewer