Skip to content

Instantly share code, notes, and snippets.

View VincentLoy's full-sized avatar
🏠
Working from home

Vincent Loy VincentLoy

🏠
Working from home
View GitHub Profile
@VincentLoy
VincentLoy / breadcrumb.jinja
Last active April 18, 2024 19:56
Easy snippet to get breadcrumb in a Wagtail page
<div class="breadcrumb-content">
{% if self.get_ancestors|length > 1 %}
<ul class="breadcrumb">
{% for p in self.get_ancestors %}
{% if p.is_root == False %}
<li><a href="{{ p.url }}">{{ p.title }}</a></li>
{% endif %}
{% endfor %}
<li class="active">{{ self.title }}</li>
@VincentLoy
VincentLoy / error.txt
Last active April 12, 2024 02:12
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
Err:19 https://packages.sury.org/php stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
Ign:26 http://ftp.au.debian.org/debian stretch InRelease
Hit:27 http://ftp.au.debian.org/debian stretch Release
Fetched 456 kB in 2s (189 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.sury.org/php stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Some index files failed to download. They have been ignored, or old ones used instead.
@VincentLoy
VincentLoy / metutils.py
Created May 12, 2015 16:42
some weather utilities functions
#!/usr/bin/env python
"""
Tropical Cyclone Risk Model (TCRM) - Version 1.0 (beta release)
Copyright (C) 2011 Geoscience Australia
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@VincentLoy
VincentLoy / createwp.sh
Created May 28, 2019 17:00
create new wordpress project, ready to use | FOR DEV ONLY !! DO NOT USE IN PRODUCTION !! :D :D
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "You must run this script as SUDO"
exit 0
fi
if [ -d ./$1 ]
then
echo ">>> Folder Already exists"
@VincentLoy
VincentLoy / yacp-custom-template.css
Created April 29, 2019 22:07
YACP Custom Countdown Theme CSS Example
/*
* Project : simply-countdown
* File : simplyCountdown.theme.custom
* Author : Your Name <your-mail[at]example.com>
*/
.simply-countdown-custom {
/* The countdown */
}
.simply-countdown-custom > .simply-section {
# Fix bad default values
sed -i -e "s/0000-00-00 00:00:00/2018-01-01 00:00:00/g" file.sql
sed -i -e "s/OLD_DB_PREFIX/NEW_DB_PREFIX/g" file.sql # if needed
# Update mysql configuration because of dirty DB (/etc/mysql/mysql.conf.d/mysql.cnf in Ubuntu server
[mysqld]
innodb_log_file_size = 512M
innodb_strict_mode = 0
# then drop the original DB if needed, and created it once again
@VincentLoy
VincentLoy / example_1.twig
Created November 20, 2018 18:33
ACF File Field + Timber Twig
{% set file = TimberImage(post.download_kit) %}
<a href="{{ file.src }}" target="_blank">Download Stuff Bro</a>
@VincentLoy
VincentLoy / post.html
Created November 15, 2018 15:15
Wordpress Post Basic styles Test Post
<h1>Level 1 title</h1>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus varius, ex at dictum cursus, metus tellus imperdiet erat, nec feugiat est dolor at lorem. Curabitur augue odio, <strong>aliquam non congue id</strong>, egestas id ex. Integer dui turpis, venenatis a ipsum non, fermentum pretium elit. Morbi magna diam, consectetur dapibus ex a, luctus lobortis purus. <strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. <a href="https://vincent-loy.fr">Cras eget mi fermentum risus porttitor molestie</a> a eget quam. In malesuada metus dolor, vehicula fringilla sapien semper in. Vivamus ut molestie eros, et sodales est. Fusce leo ante.
<h2>Level 2 title</h2>
Placerat sit amet vehicula eget, accumsan eget lacus. Nunc ut mi fringilla, laoreet eros vitae, <a href="https://vincent-loy.fr">accumsan</a> sem. Aliquam fermentum lorem ut sapien pharetra fermentum (<em>Praesent a dui sed quam luctus vulputate at non erat</em>) Nullam laoreet dui
@VincentLoy
VincentLoy / bootstrap-contact-form-7-scss-alert-snippet.scss
Created September 13, 2018 13:46
SCSS Snippet for Contact Form 7 Alerts
div.wpcf7-response-output {
@extend .alert;
}
div.wpcf7-mail-sent-ok {
@extend .alert-success;
}
div.wpcf7-mail-sent-ng,
div.wpcf7-aborted {
@VincentLoy
VincentLoy / index.html
Last active March 15, 2018 12:46
scanit example html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>scanit.js</title>
<!-- JUST ADD SOME STYLES FOR YOU QR CODE ELEMENT (Basically, a square) -->
<style>
.qrContainer {
width: 450px;
height: 450px;