Skip to content

Instantly share code, notes, and snippets.

@tripu
tripu / .gitignore
Created February 18, 2019 08:55
Git ignore file
.vscode/
@tripu
tripu / .gitconfig
Last active February 18, 2019 09:00
Git config file
[alias]
ap = add -p
br = branch
cf = config
ci = commit
co = checkout
df = diff
lg = log --graph --abbrev-commit --decorate --date=relative --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
pl = pull
ps = push
@tripu
tripu / vs-ext-to-md.md
Last active January 28, 2019 12:39
One-liner to dump all installed VS Code extensions as a Markdown list

This is a script I just wrote to share my installed extensions easily on this other Gist.

Example

user@host:~/whatever/dir$ (
>     for i in `ls ~/.vscode/extensions/ | rev | cut -d '-' -f 2- | rev`; do
>         NAME=$(cat ~/.vscode/extensions/$i*/package.json | jq .displayName | cut -d \" -f 2)
>         echo "* [$NAME](https://marketplace.visualstudio.com/items?itemName=$i)"
>     done
@tripu
tripu / calendar-madrid-2019.txt
Created December 21, 2018 20:55
All public holidays in 2019 for Madrid city (Spain), in RTM format
Public holiday (Spain): Año Nuevo !1 #Spain #holiday ^1 Jan 2019
Public holiday (Spain): Epifanía del Señor !1 #Spain #holiday #weekend ^7 Jan 2019
Public holiday (Spain): Jueves Santo !1 #Spain #holiday #weekend ^18 Apr 2019
Public holiday (Spain): Viernes Santo !1 #Spain #holiday #weekend ^19 Apr 2019
Public holiday (Spain): Fiesta del Trabajo !1 #Spain #holiday ^1 May 2019
Public holiday (Madrid region): Fiesta de la CAM !1 #Spain #holiday #Madridregion ^2 May 2019
Public holiday (Madrid city): San Isidro Labrador !1 #Spain #holiday #Madridcity ^15 May 2019
Public holiday (Spain): Asunción de la Virgen !1 #Spain #holiday ^15 Aug 2019
Public holiday (Spain): Fiesta de la Hispanidad !1 #Spain #holiday #weekend ^12 Oct 2019
Public holiday (Spain):
@tripu
tripu / gh-graphql.md
Last active October 20, 2018 21:56
GH API v4 GraphQL snippets

👉 GH GraphQL API Explorer

My first comments on an issue, on a commit, and on a Gist

{
  viewer {
    issueComments(first: 1) {
      nodes {
 ...commonFields
@tripu
tripu / npm-check.txt
Last active January 22, 2018 17:12
w3c/spork vulnerabilities (after)
$ npm-check
emailjs NOTUSED? Still using emailjs?
Depcheck did not find code similar to require('emailjs') or import from 'emailjs'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save emailjs
nopt NOTUSED? Still using nopt?
Depcheck did not find code similar to require('nopt') or import from 'nopt'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
@tripu
tripu / npm-check.txt
Last active January 22, 2018 16:56
w3c/spork vulnerabilities
$ npm-check
urijs NOTUSED? Still using urijs?
Depcheck did not find code similar to require('urijs') or import from 'urijs'.
Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
Use --skip-unused to skip this check.
To remove this package: npm uninstall --save urijs
emailjs MAJOR UP Major update available. https://github.com/eleith/emailjs#readme
npm install --save emailjs@1.0.12 to go from 0.3.16 to 1.0.12
NOTUSED? Still using emailjs?
@tripu
tripu / ubuntu-artful-upgrade-troubleshooting.md
Created January 18, 2018 08:33
Ubuntu 17.10 "Artful Aardvark" upgrade troubleshooting

NB: beware of this bug!

Bug: gdm can't unlock desktop (after suspending, to switch users, etc)

Symptoms: lock screen takes very long (ie, a few seconds) to process username+password, returns “authentication error”, and becomes impossible to log in and unlock the screen again, with any user.

Also, /var/log/syslog shows:

Failed to add watch on /run/systemd/ask-password: No space left on device
@tripu
tripu / calendar-madrid-2018.txt
Last active December 26, 2017 15:06
All public holidays in 2018 for Madrid city (Spain), in RTM format
Public holiday (Spain): Año Nuevo !1 #Spain #holiday #weekend ^1 Jan 2018
Public holiday (Spain): Epifanía del Señor !1 #Spain #holiday #weekend ^6 Jan 2018
Public holiday (Spain): Jueves Santo !1 #Spain #holiday #weekend ^29 Mar 2018
Public holiday (Spain): Viernes Santo !1 #Spain #holiday #weekend ^30 Mar 2018
Public holiday (Spain): Fiesta del Trabajo !1 #Spain #holiday ^1 May 2018
Public holiday (Madrid region): Fiesta de la CAM !1 #Spain #holiday #Madridregion ^2 May 2018
Public holiday (Madrid city): San Isidro Labrador !1 #Spain #holiday #Madridcity ^15 May 2018
Public holiday (Spain): Asunción de la Virgen !1 #Spain #holiday ^15 Aug 2018
Public holiday (Spain): Fiesta de la Hispanidad !1 #Spain #holiday #weekend ^12 Oct 2018
Public holiday (Spain):
@tripu
tripu / normalise-podcasts.sh
Created December 9, 2017 21:16
Increase volume of podcasts
#!/bin/sh
INPUTDIR="/home/tripu/gPodder/Downloads/"
PREFIXLENGTH=6
OUTPUTDIR=/home/tripu/t/personal/podcasts/
GAIN=2.5
find "$INPUTDIR" -regextype egrep -iregex '.+\.mp3$' | while read f; do
SHORT=$(echo $f | cut -d'/' -f"$PREFIXLENGTH"-)
echo -n "$SHORT… "