Skip to content

Instantly share code, notes, and snippets.

@janniks
janniks / prepare-commit-msg.sample
Last active September 29, 2019 19:17
MOVED https://github.com/janniks/prepare-commit-msg - Automatically prefix commit messages with the current branches issue number
MOVED TO:
https://github.com/janniks/prepare-commit-msg
@janniks
janniks / install.sh
Last active September 29, 2019 19:18
MOVED https://github.com/janniks/prepare-commit-msg - Install prepare-commit-msg git hook
MOVED TO:
https://github.com/janniks/prepare-commit-msg
@janniks
janniks / sprint-calendar-week.3h.rb
Last active November 12, 2018 17:13
BitBar - Sprint number and remaining days
#!/usr/bin/env ruby
require 'date'
def getSprintNumber(date)
shifted = date - 1 # shift date (sprint starts on tuesday)
weeknumber = shifted.cweek + 1 # adjust for you sprint numbering
weeknumber /= 2 # two week sprints
weeknumber.ceil
end
99,100c99,102
< SPACESHIP_GIT_STATUS_PREFIX="${SPACESHIP_GIT_STATUS_PREFIX:=" ["}"
< SPACESHIP_GIT_STATUS_SUFFIX="${SPACESHIP_GIT_STATUS_SUFFIX:="]"}"
---
> # CUSTOM-EDIT # SPACESHIP_GIT_STATUS_PREFIX="${SPACESHIP_GIT_STATUS_PREFIX:=" ["}"
> SPACESHIP_GIT_STATUS_PREFIX="${SPACESHIP_GIT_STATUS_PREFIX:=" "}"
> # CUSTOM-EDIT # SPACESHIP_GIT_STATUS_SUFFIX="${SPACESHIP_GIT_STATUS_SUFFIX:="]"}"
> SPACESHIP_GIT_STATUS_SUFFIX="${SPACESHIP_GIT_STATUS_SUFFIX:=""}"
316c318
< echo -n "%{%B%}" # set bold
@janniks
janniks / zsh_update_all
Last active May 2, 2019 15:18
Update zsh & Oh Mh Zsh & custom plugins/themes
#!/usr/bin/env zsh
COLOR_RESET='\033[0m'
COLOR_BLUE='\033[0;34m'
echo "\n${COLOR_BLUE}Updating zsh${COLOR_RESET}"
brew upgrade zsh
echo ""
/usr/bin/env zsh -i -c upgrade_oh_my_zsh
@janniks
janniks / 01-local-import.js
Last active April 22, 2020 09:25
01 - A Better Way to Import Local Node.js Modules - An Article
const myModule = require('./MyModule')
@janniks
janniks / 02-messy-require.js
Created April 22, 2020 09:26
02 - A Better Way to Import Local Node.js Modules - An Article
const randomRelative = require('../../../../../somewhere/deep/and/random')
@janniks
janniks / 03-app-root-path.js
Created April 22, 2020 09:37
03 - A Better Way to Import Local Node.js Modules - An Article
const projectRoot = require('app-root-path');
const random = require(projectRoot + '/somewhere/deep/and/random.js');
// OR using .require
const requireLocal = require('app-root-path').require
const random = requireLocal('somewhere/deep/and/random');
@janniks
janniks / 04-using-basetag.js
Created April 22, 2020 10:12
04 - A Better Way to Import Local Node.js Modules - An Article
const randomRelative = require('../../../../../somewhere/deep/and/random')
// Using 'basetag' becomes...
const randomBasetag = require('$/somewhere/deep/and/random')
@janniks
janniks / setup.sh
Created December 10, 2020 12:05
macOS setup script
#!/usr/bin/env bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
echo ""
echo "Download the official Dropbox app manually and sync relevant dotfiles"
echo "Press [Enter] to continue or [Ctrl-C] to cancel..."
read -p ""
echo ""