Skip to content

Instantly share code, notes, and snippets.

View vinvin27's full-sized avatar
🎯
Focusing

Vincent vinvin27

🎯
Focusing
View GitHub Profile
@vinvin27
vinvin27 / FixLoveGreenPencilsMalware.sh
Created January 25, 2021 16:24 — forked from black-dragon74/FixLoveGreenPencilsMalware.sh
Fixes love green pencils wordpress malware
#!/bin/bash
# Regex to fix DB is: "s/<script[\s\S]*?>[\s\S]*?<\/script>//g"
totalInfections=0
filesProcessed=0
echo "Welcome to lovegreenpencils malware fixer by black-dragon74"
echo "This fix is divided into 3 phases."
echo "Phase 1 fixes the \`beckup\` files."
@vinvin27
vinvin27 / Breadcrumb Prestashop 1.6
Created January 22, 2020 03:34
Correction pour Prestashop 1.6 du fichier breadcrumb.tpl. Le type data-vocabulary.org est déprécié par Google - Plus d'information ici : https://www.vinvin.dev/fils-dariane-problemes-detectes/
{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}
{if !empty($path)}
{* Extract bradcrumb links from anchors *}
{$matchCount = preg_match_all('/<a.+?href="(.+?)"[^>]*>([^<]*)<\/a>/', $path, $matches)}
{$breadcrumbs = []}
{for $i=0; $i<$matchCount; $i++}
{$breadcrumbs[] = ['url' => $matches[1][$i], 'title' => $matches[2][$i]]}
{/for}
# o2switch pagespeed start / DO NOT REMOVE OR EDIT
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRewriteLevel PassThrough
ModPagespeedEnableFilters add_head,make_show_ads_async,make_google_analytics_async,canonicalize_javascript_libraries,collapse_whitespace,combine_css,combine_javascript,combine_heads,convert_meta_tags,dedup_inlined_images,defer_javascript,elide_attributes,extend_cache,recompress_images,flatten_css_imports,hint_preload_subresources,inline_css,inline_javascript,lazyload_images,rewrite_javascript,move_css_above_scripts,move_css_to_head,insert_dns_prefetch,remove_comments,remove_quotes,rewrite_images,strip_image_meta_data,sprite_images
</IfModule>
# o2switch pagespeed end / DO NOT REMOVE OR EDIT
@vinvin27
vinvin27 / wp_user_roles.txt
Created December 30, 2019 15:54
wp_user_roles - Voici les valeurs par défaut de la meta_key wp_user_role. /!\ Il faut que la clef commence par le prefixe de base de donnée. plus de détail ici : https://www.vinvin.dev/desole-vous-navez-pas-lautorisation-dacceder-a-cette-page/
a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:62:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"d
a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:62:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"d
@vinvin27
vinvin27 / 00-generate-ssh-key.txt
Last active January 29, 2021 00:35 — forked from tommcfarlin/00-generate-ssh-key.txt
Comment migrer ses dépôts Bitbucket vers Github : Le tuto complet ici https://www.vinvin.dev/migration-de-bitbucket-a-github-le-tuto/
$ ssh-keygen -t rsa -b 4096 -C "ton@email.com"
@vinvin27
vinvin27 / gist:e9a41449274b4bf8c280595e16c9ebf2
Created September 17, 2017 13:18
DB Credentials generator :D
#!/bin/bash
DOMAIN=$1
if [ -z "${DOMAIN}" ]; then
echo "Syntax: $0 <domain.com>"
exit 1
fi
MYSQL_DB=${DOMAIN}
MYSQL_USER=$(echo ${DOMAIN} | sed 's/[^a-zA-Z0-9]//g' | cut -c1-15)
var ctx, color = "#000";
$(document).ready(function () {
// reset palette selection (css) and select the clicked color for canvas strokeStyle
$(".palette").click(function(){
$(".palette").css("border-color", "#777");
$(".palette").css("border-style", "solid");
$(this).css("border-color", "#fff");
$(this).css("border-style", "dashed");
color = $(this).css("background-color");