Skip to content

Instantly share code, notes, and snippets.

View schellenbergk's full-sized avatar
💭
Making magic happen at @3magine

Karl Schellenberg schellenbergk

💭
Making magic happen at @3magine
View GitHub Profile
@schellenbergk
schellenbergk / utils.js
Last active October 5, 2020 21:14
utils.js
import Vue from 'vue'
/* eg:
head() {
const { baseUrl, env } = this.$config
const robots = env === 'production' ? false : 'noindex, nofollow'
const title = 'My Title'
const description =
'My Description'
const url = `${baseUrl}/`
document.querySelectorAll('.next-input').forEach(i => {
let replacements = [
'-taxes-fees-included',
'-taxes-and-fees-included',
'-taxes-fees-inluded',
'-taxes-fee-included',
'-tax-fees-included',
'-taxes-fees-incl'
];
//mixins:
@import "~poly-fluid-sizing/poly-fluid-sizing";
// eg. @include poly-fluid-sizing('height', ($mobileL:666px, $tablet:613px));
// eg. @include grid-spacing($spc:20px,$vertical:$laptop);
@mixin grid-spacing($spc: 10px, $vertical: $tablet) {
$spc-half: ($spc/2);
margin-left: -$spc-half;
#!/bin/bash
# usage examples:
# toWebP.sh "*.png" # convert all png's in current directory
# toWebP.sh "icon-*.jpg" # convert all jpg's that start with "icon-"
if [ $# -eq 0 -o -z "$1" ]; then
echo "No file pattern supplied";
exit 1;
fi
@schellenbergk
schellenbergk / .editorconfig
Last active February 23, 2019 16:16
My Editor Configuration
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@schellenbergk
schellenbergk / grayscale.css
Created December 20, 2017 15:44
Grayscale Image
img.grayscale {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
@schellenbergk
schellenbergk / mysql_to_csv.sh
Created October 24, 2017 15:42
Export mysql data into csv
#!/bin/bash
mysql -u db_user -p db_db -e "select firstname, lastname, email from users" -B | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > list.csv
@schellenbergk
schellenbergk / cron_monitor_mysql
Last active October 19, 2017 15:27 — forked from mheadd/monitor.sh
Simple bash script to check whether MySQL is running.
#!/bin/bash
# crontab -e
# add:
# */5 * * * * /root/bin/cron_monitor_mysql > /dev/null 2>&1
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";