Skip to content

Instantly share code, notes, and snippets.

View digitalgeneralist's full-sized avatar

Benjamin Sernji digitalgeneralist

View GitHub Profile
(function($) {
function triggerColLeftIcon(){
$('.col-icon-left').css({'display':'none!important'});
$('.col-icon-right').css({'display':'block!important'});
}
function triggerColRightIcon(){
$('.col-icon-right').css({'display':'none!important'});
$('.col-icon-left').css({'display':'block!important'});
}
$('.col-icon-left').on('click', function(){
(function($) {
// fileinput bei android deaktivieren
if(navigator.userAgent.match(/Android/i)){}else{
$.getScript("sites/all/themes/fragnebenan/js/fileinput.min.js", function(){
console.log('fileinput laden');
});
}
})(jQuery);
if(navigator.userAgent.match(/Android/i)){$('#mobile-right-col').addClass('mt45');}else{
$.getScript("sites/all/themes/fragnebenan/js/fileinput.min.js", function(){
console.log('fileinput laden');
$.getScript("sites/all/themes/fragnebenan/js/script.js", function(){
console.log('script laden');
});
});
@digitalgeneralist
digitalgeneralist / firebase.json
Created August 11, 2017 16:53
Hosting React App on Firebase, PageSpeed Tools Insights needs Cache-Control for your js files (min. 1 week)
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)",

Keybase proof

I hereby claim:

  • I am 10111dg on github.
  • I am mondoshawan (https://keybase.io/mondoshawan) on keybase.
  • I have a public key ASBLvLcQaC33mjcOo-fuVEJm1qKgJMoLWofWm2hwdo18vAo

To claim this, I am signing this object:

@digitalgeneralist
digitalgeneralist / gist:fdda9c70865a9dc38ef5361fbe6521a2
Created May 6, 2018 10:18
Backup and restore Docker Containers ex.
#save
docker save myusername/myproject:latest | gzip -c > myproject_img_bak05052018.tgz
#restore
gunzip -c myproject_img_bak05052018.tgz | docker load
@digitalgeneralist
digitalgeneralist / mysql-docker.sh
Created May 11, 2018 07:29 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@digitalgeneralist
digitalgeneralist / sql
Created July 11, 2018 10:10
delete all Categories Magento 2.2.x
DELETE FROM `catalog_category_entity` WHERE `entity_id` >= 3;
ALTER TABLE `catalog_category_entity` AUTO_INCREMENT = 3;
@digitalgeneralist
digitalgeneralist / 20auto-upgrades
Created December 7, 2018 09:41
Activate on Ubuntu 18.04 auto-upgrades for security patches (/etc/apt/apt.conf.d/)
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
// You can set other product data with $product->setAttributeName() if you want to update more data
if ($product->getPrice() != $price) {
$product->setPrice($price)
->setStoreId(0) // this is needed because if you have multiple store views, each individual store view will get "Use default value" unchecked for multiple attributes - which causes issues.
->save();
}