Skip to content

Instantly share code, notes, and snippets.

@spyesx
spyesx / console-save.js
Created November 1, 2019 04:47
A simple way to save objects as .json files from the console, includes a chrome extension along with a plain script.
// Source : http://bgrins.github.io/devtools-snippets
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
@spyesx
spyesx / 5G-vote.js
Last active November 27, 2019 16:10
5G Vote
var cleanStorage = function(){
console.log('%c Start clean localStorage', 'color: green')
var myStorage = window.localStorage;
var ids = Object.keys(myStorage).filter( (key) => {
return key.slice(0,3) === '5G_'
})
ids.forEach( (id) => {
console.log('clean: '+id)
window.localStorage.removeItem(id);
})
apiVersion: v1
data:
auth: <SECRET>
kind: Secret
metadata:
name: staging-basic-auth
type: Opaque
@spyesx
spyesx / optimize_pdf_size.sh
Created January 24, 2020 04:20
Optimize PDF size by changing it's density
# https://explainshell.com/explain?cmd=convert+-density+200x200+-quality+60+-compress+jpeg+input.pdf+output.pdf
convert -density 200x200 -quality 60 -compress jpeg input.pdf output.pdf
@spyesx
spyesx / detox_rename_filenames.sh
Created February 4, 2020 04:22
Clean up and lowercase filenames
# https://explainshell.com/explain?cmd=detox+-s+iso8859_1+-r+-v+.%2F*
detox -s iso8859_1 -r -v ./*
# Lowecase filenames
# linux
rename 'y/A-Z/a-z/' *
# macOS needs to be forced
@spyesx
spyesx / semantic-commit-messages.md
Last active August 29, 2020 16:29 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@spyesx
spyesx / 1.get-volume-names.md
Last active August 25, 2020 12:27
Mount all docker volumes in an Alpine container for inspection. I use this on macOS since docker volumes are not directly accessible.

Get all volumes' names

$ docker volume ls | awk '{print $2}' | grep -v 'VOLUME'
> 0d8ffd800baf623b030e727829f6a31dd05a0ed73877021f018a849be0ce6433
> 0dc6353456b723b4885f556fb49938b497bdea4bf792bca12d7b5c6ef12dcf16
> 2a579e3e73596349308a4ece576f00c6822f1a04481965f6b8ed366b771dd5ea
@spyesx
spyesx / curl-to-nextcloud.sh
Created September 14, 2020 07:52
Upload a file to Nextcloud with curl
# source: https://docs.nextcloud.com/server/19/user_manual/files/access_webdav.html#accessing-files-using-curl
curl -u USERNAME:PASSWORD -T /path/to/file https://my.nextcloud.tld/remote.php/dav/files/USERNAME/path/to/directory/
body{
background:none;
font-family:arial;
max-width:1440px;
margin:0 auto;
font-size:16px;
}
h1,h2{
color:white;
@spyesx
spyesx / gist:411f312f3b6a346b26113f37af6232df
Created September 17, 2021 10:07 — forked from ayamflow/gist:b602ab436ac9f05660d9c15190f4fd7b
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);