This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias dirsize="du --max-depth=1 -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Establish a cache name | |
const hostname = self.location.hostname.replace(".", "_") | |
const cacheName = hostname + "_cache" | |
// On fetch, function can't be async | |
// Otherwise the handler would not run | |
self.addEventListener("fetch", (event) => { | |
// Filter out queries not supported by cache | |
if (!event.request.url.match(/^https:\/\/?/)) { | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"height": 20, | |
"infinite": false, | |
"layers": [ | |
{ | |
"data": [ | |
70, | |
70, | |
70, | |
70, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.slice.call( | |
document.querySelectorAll('.MNGridView td.Amount > .MNText.StandardListAmount.Amount') | |
).map(o => | |
o.innerText | |
.replace(/,/g, '.') | |
.replace(/\s/g, '') | |
).reduce((acc, next) => { | |
acc += parseFloat(next); | |
return acc; | |
}, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
export default angular.module('myApp') | |
.directive('ngParallax', [ | |
'myStorage', | |
(myStorage) => ({ | |
restrict: 'AE', | |
scope: { | |
pattern: '=', | |
reverse: '=', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input=$(node -p "encodeURIComponent('${*//\'/\\\'}')") | |
google-chrome --start-fullscreen --chrome-frame --app="https://www.google.com/search?hl=en&btnI=I%27m+Feeling+Lucky&pws=0&q=$input" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# resize files downscale 50% when bigger than 800kb - run until happy or from cron | |
find . -size 0 -print0 | xargs -0 rm | |
minimumsize=800000 | |
for i in * ; do | |
actualsize=$(wc -c < "$i") | |
echo "parsing file $i" | |
if [ $actualsize -ge $minimumsize ]; then | |
convert "$i" -resize 50% "$i" | |
echo "ok" |