Skip to content

Instantly share code, notes, and snippets.

View siriusnottin's full-sized avatar

Sirius siriusnottin

View GitHub Profile
#!/usr/bin/bash
[ -z ${1} ] && echo "Missing filename! Exiting..." && exit 1
DEFAULT_SHEBANG="#!/usr/bin/bash"
FILE_NAME="${1}.sh"
echo "Creating script file ${FILE_NAME}..."
touch ${FILE_NAME}
echo -e "${DEFAULT_SHEBANG}\n\n" > ${FILE_NAME}
chmod +x ${FILE_NAME}
@siriusnottin
siriusnottin / WebStorm_CheatSheet.md
Last active October 2, 2021 22:24
My most useful WebStorm shortcuts.

WebStorm shortcuts: my Cheat Sheet

My most useful WebStorm shortcuts, transitioning from VSC after a while not programming.

I keep this list aside from my IDE.

Best to know

Double Shift : Search everywhere Cmd O : Navigate class Shift Cmd O : Navigate files Cmd Shift O : Navigate symbol

@siriusnottin
siriusnottin / README.md
Last active July 28, 2019 08:53
Update and use WP-CLI with Trellis and Bedrock (and install language packs for all plugins)

Use WP-CLI with Trellis and Bedrock

WP-CLI is installed by Trellis automatically but at the moment it is not the latest version. It’s not very annoying but a command I wanted to use was not available with this version. Not being very comfortable using WP-CLI with Trellis, I couldn’t update it correctly until today.

So here is a little guide that could help people who would be stuck like me!

Read the documentation

Read the Trellis documentation carefully. One passage in particular should be noted regarding the use of WP-CLI correctly with Trellis and Bedrock:

@siriusnottin
siriusnottin / d3-json-import.js
Created March 20, 2019 12:32
D3.js Json import from API with secret key.
d3.json("API_URL", {
headers: {
"Authorization": "Bearer API_KEY"
}
})
.then(function(data) {
// Your code here...
}); // d3.json
@siriusnottin
siriusnottin / gist:3f92432f11150a4668fb6570111ee655
Created August 16, 2018 12:54
Create multiple folders (Mac OSX)
# Create a file (named concerts.txt in this case) containing the names of all folders to create :
nano concerts.txt
# In my case this file lists concerts (one for each line). The name of each folder must be in quotation marks. Example :
"Concert name 1"
"Concert name 2"
"Concert name 3"
"Concert name 4"
# Now execute this command by changing the file name :
/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
@siriusnottin
siriusnottin / gist:c2eb812e21d76657d41d000ff85b15da
Last active June 25, 2018 12:55
Google Sheets custom regex
// TEXT BETWEEN BRACKETS
=REGEXEXTRACT(B2;"\((.*)\)")
// TEXT AFTER COMMA (WITH SPACES AFTER & BEFORE)
=REGEXEXTRACT(B2;" : (.*)")
npm install npm-install-all -g
npm-install-all gulpfile.js
composer require wpackagist-theme/themename:*