Skip to content

Instantly share code, notes, and snippets.

View vipickering's full-sized avatar
🦧
Contemplating things

Vincent Pickering vipickering

🦧
Contemplating things
View GitHub Profile
var mediumIntegrationToken = "REPLACE_WITH_YOUR_MEDIUM_INTEGRATION_TOKEN";
// That's it. No need to edit anything else below.
// split the comma-separated tags string into an array then remove any whitespace
var tagsArray = input.medium_tags.split(',');
for (var i = 0; i < tagsArray.length; i++) {
tagsArray[i] = tagsArray[i].trim();
}
@vipickering
vipickering / terminal
Last active September 5, 2017 13:56
Git Panic
alias panic="branchName='$(date +%Y-%m-%d-%H-%M)' && git checkout -b panic-'${branchName}' && git add -A && git commit -m 'panic' && git push --set-upstream origin panic-'${branchName}'"
@vipickering
vipickering / terms.json
Last active March 30, 2017 16:25
text lint terminology - custom tech terms
[
"CSS",
"Browsersync",
"ESLint",
"JavaScript",
"Lodash",
"Markdown",
"Sass",
"UglifyJS",
"Chromium",
# Add SSH to login
# The first time terminal is opened after start, password will be entered.
# All subsequent requests will use SSH Agent.
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add
@vipickering
vipickering / ninoCheck.js
Created October 12, 2016 13:45
Validate NINO Functions (Node)
// National Insurance Validation Module.
// Sanitise the NINO by first passing through this function, which will strip out space and dashes, then convert to uppercase.
exports.sanitise = function sanitise(nino) {
return nino.toUpperCase().replace(/[\s|\-]/g, '');
};
// You can make the last letter optional by using this function.
exports.validateLoose = function validateLoose(nino) {
var regex = /^(?!BG|GB|NK|KN|TN|NT|ZZ)[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-D]{0,1}$/;

Nunjucks Filters Missing Documentation

abs

Return the absolute value of the argument:

Input

Contract Of Work

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@vipickering
vipickering / vinnyterminaltheme.zsh-theme
Created September 24, 2013 10:23
Terminal: Zsh Theme Setup
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function get_pwd() {
print -D $PWD
}
function put_spacing() {
@vipickering
vipickering / Markdown.sublime-settings
Last active December 3, 2016 15:22
Sublime: Markdown Settings
{
"binary_file_patterns":
[
"*.dds",
"*.eot",
"*.gif",
"*.ico",
"*.jar",
"*.jpeg",
"*.jpg",
@vipickering
vipickering / MultiMarkdown.sublime-settings
Created September 23, 2013 16:02
Sublime: Multi Markdown Settings
{
// Which file extensions go with this file type?
"extensions":
[
"md",
"mdown",
"mdwn",
"mmd",
"txt"
],