Skip to content

Instantly share code, notes, and snippets.

View janssens's full-sized avatar
🥕
"Pachamama t'appelle, bro"

Janssens Gaëtan janssens

🥕
"Pachamama t'appelle, bro"
View GitHub Profile
@janssens
janssens / iframe.php
Created May 8, 2020 13:16
large iframe on home lelefan espace membre
</div><!-- !.announcement -->
</div><!-- !.container -->
<iframe src="https://letempsestvenu.org/5-propositions" width="100%" height="400px" style="border:0;"></iframe>
<div class="container center">
<div class="announcement">
@janssens
janssens / gmailHack.css
Last active January 15, 2020 14:19
Gmail stylesheet
/*content center and max 1000px*/
.bkK {
max-width: 1000px !important;
margin:auto;
}
.Ao{
border-radius: 8px;
overflow: hidden;
}
/*left panel*/
@janssens
janssens / DarkThemeDeepinBehaviorFix.user.js
Created January 9, 2020 15:25
DarkThemeDeepinBehaviorFix UserScript
// ==UserScript==
// @name DarkThemeDeepinBehaviorFix
// @description Firefox clean behavior while using Deepin dark theme
// @version 1
// @author Gaëtan JANSSENS
// @include *
// @icon https://www.linuxinsider.com/ai/671878/linux-distro-international.jpg
// @run-at document-end
// @grant none
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am janssens on github.
  • I am petit_nuage (https://keybase.io/petit_nuage) on keybase.
  • I have a public key ASBhagTDd_TpbjG11OUANscUIqZv_ptSzB6GP6cOdhvxigo

To claim this, I am signing this object:

@janssens
janssens / refresh_eav_entity_store.sql
Last active June 4, 2018 13:52
Magento sql script to regenerate eav_entity_store table.
TRUNCATE eav_entity_store;
INSERT INTO eav_entity_store (entity_type_id,store_id,increment_prefix,increment_last_id)
SELECT
'5' AS entity_type_id,
store_id AS store_id,
store_id AS increment_prefix,
increment_last_id AS increment_last_id
FROM (SELECT store_id as store_id, MAX(increment_id) as increment_last_id FROM sales_flat_order WHERE store_id is not NULL GROUP BY store_id) as tmp;
@janssens
janssens / file.sh
Created February 5, 2018 10:35
File jpeg files in sub dir from name
#!/bin/bash
for f in *.jpg
do
y=$( echo $f | sed 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)_.*/\1/')
m=$( echo $f | sed 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)_.*/\2/')
[ -d $y ] || mkdir $y
[ -d "$y/$m" ] || mkdir "$y/$m"
mv $f "./$y/$m"
echo "$f moved to $y/$m"
done
@janssens
janssens / ploplog.php
Last active December 7, 2017 15:51
ploplog, simple php log function
<?php
function plopLog($var,$file){
ob_start();
var_dump($var);
$output = ob_get_clean();
$outputFile = dirname(__FILE__).DS.$file;
$fileHandle = fopen($outputFile, 'a') or die("File creation error :".$outputFile);
fwrite($fileHandle, $output);
fclose($fileHandle);
@janssens
janssens / newAdminMagento1.php
Created July 12, 2017 17:24
create admin user magento 1
<?php
# Create New admin User programmatically.
require_once('./app/Mage.php');
umask(0);
Mage::app();
try {
$user = Mage::getModel('admin/user')
->setData(array('username' => 'my_username',
'firstname' => 'my_firstname',
@janssens
janssens / dploy.sh
Last active June 26, 2017 10:12
dploy new release from git
#!/bin/bash
cd /root/git/$1/
git pull
rsync --exclude='/.git' --filter='dir-merge,- .gitignore' -r --delete-after /root/git/$1/ /var/www/$1/
mv /var/www/$1/app/etc/local.xml.$1 /var/www/$1/app/etc/local.xml
php /root/script/cc.php $1
@janssens
janssens / backup-prod-and-update-preprod.sh
Last active June 21, 2017 16:12
Script to backup Magento DB and Update Preprod Env from this
#!/bin/bash
NOW=$(date +"%d-%m-%Y-%H-%M-%S")
SQL_DUMP_FILE="backupProd.$NOW.sql"
SQL_PREPROD_FILE="preprod.sql"
NEW_BACKUP_FILE="lastBackup.gz"
OLD_BACKUP_FILE="previousBackup.gz"
SQL_USER="--MYSQL_USER--"
SQL_PASSWORD="--MYSQL_PASSWORD--"
SQL_SOURCE_DB_NAME="--MYSQL_SOURCE_DB_NAME--"
SQL_TARGET_DB_NAME="--MYSQL_TARGET_DB_NAME--"