Skip to content

Instantly share code, notes, and snippets.

@favio41
favio41 / .gitconfig
Last active March 14, 2023 08:36
Alias for .gitconfig
[alias]
ready = !"git fetch --all && git checkout develop && git pull --rebase && git fetch-main && git branch --no-color | grep -v main | grep -v develop | xargs -r git branch -D"
graph1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
graph2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
graph = !"git graph1"
fetch-develop = fetch origin develop:develop
fetch-master = fetch origin master:master
fetch-main = fetch origin main:main
amend = commit -a --amend
undo = reset --soft HEAD~1
document.addEventListener('keydown', (e) => { if(e.code === 'KeyN') { document.querySelector('.game-controls-item[data-action="pencil"]').dispatchEvent(new MouseEvent('mousedown', {view: window, bubbles: true, cancelable: true })); } } )
@favio41
favio41 / .vscode_settings.json
Last active August 12, 2021 12:20
Settings for vscode
{
"editor.tabSize": 2,
"files.associations": {
".env": "properties"
},
"workbench.colorTheme": "Monokai",
"editor.rulers": [80,120],
"workbench.colorCustomizations": {
"editorRuler.foreground": "#40404050"
},
{
"Print object to console":{
"prefix": "stringify",
"body": "console.log(\"stringify $0\", JSON.stringify($0, null, 2))"
},
"Safe print object to console":{
"prefix": "stringifysafe",
"body": "console.log('inspect $0',require('util').inspect($0))"
},
"saveToFile":{
@favio41
favio41 / vscode.keybindings.json
Last active October 16, 2019 16:03
keyboard shortcuts for vscode (open keyboard shortcuts)
[
{
"key": "cmd+k cmd+e",
"command": "-keybindings.editor.defineWhenExpression",
"when": "inKeybindings && keybindingFocus"
},
{
"key": "cmd+k cmd+e",
"command": "eslint.executeAutofix"
},
@favio41
favio41 / .vscode_launch.json
Last active October 9, 2019 13:34
Debug jest test of current open file
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current file",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${file}"
@favio41
favio41 / brew-java-and-jenv.md
Created February 14, 2019 17:00 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@favio41
favio41 / cloudformation.yml
Created September 19, 2018 11:00
AWS cloudformation user creation with programmatic access and s3 policy
AWSTemplateFormatVersion: '2010-09-09'
Resources:
# Setup an user
user:
Type: AWS::IAM::User
Properties:
UserName: !Join
- '-'
- - 'changeme'
console.table({
"01 - moment('2016-04-14T00:00:00+00:00').format()": moment('2016-04-14T00:00:00+00:00').format(),
"02 - moment.utc('2016-04-14T00:00:00+00:00').format()": moment.utc('2016-04-14T00:00:00+00:00').format(),
"03 - moment('2016-04-14T00:00:00+01:00').format()": moment('2016-04-14T00:00:00+01:00').format(),
"05 - new Date('2016-04-14T00:00:00+00:00')": new Date('2016-04-14T00:00:00+00:00'),
"04 - new Date(Date.parse('2016-04-14T00:00:00+00:00'))": new Date(Date.parse('2016-04-14T00:00:00+00:00')),
"09 - moment('2016-04-14T00:00:00+00:00').tz('Europe/London').format()": moment('2016-04-14T00:00:00+00:00').tz('Europe/London').format(),
"10 - moment.utc('2016-04-14T00:00:00+00:00').tz('Europe/London').format()": moment.utc('2016-04-14T00:00:00+00:00').tz('Europe/London').format(),
});
@favio41
favio41 / handy.sh
Created March 23, 2016 11:47
Linux handy commands
Show the filename without line breaking, and wait for changes.
less -S +F filename