Skip to content

Instantly share code, notes, and snippets.

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

Paul Morel PaulMorel

🏠
Working from home
View GitHub Profile
@PaulMorel
PaulMorel / import-sql-gz-devilbox.sh
Created October 9, 2022 16:42
One liner to import my specific structure of MySQL dumps for Devilbox
for i in *.sql.gz; do DB=$(grep -oP '\d{4}_\K[^.]*' <<<"$i"); echo "Importing $DB"; mysql -h mysql -u root -e "CREATE DATABASE IF NOT EXISTS $DB"; zcat "$i" | mysql -h mysql -u root "$DB"; done
@PaulMorel
PaulMorel / eagle-api-routes.md
Created November 5, 2020 17:47
Eagle API Routes

Eagle API Endpoints

What is Eagle?

Eagle is a MacOS and Windows application to organize assets such as images|fonts|audio|video and more. I think of it like a self-hosted visual bookmarking tool like Pinterest|Designspiration|fffound (RIP)|etc.

You can learn more about the application on their website https://eagle.cool/

API Endpoints

@PaulMorel
PaulMorel / rand-ss.php
Created October 8, 2020 18:52
Random Stylistic Sets
<style>
.h1, .prose h1 {
font-feature-settings: "ss<?= str_pad(mt_rand(1,5), 2, '0', STR_PAD_LEFT) ?>";
}
</style>
@PaulMorel
PaulMorel / tailwind.config.js
Created August 15, 2020 13:28
Extend example
const defaultTheme = require("tailwindcss/defaultTheme");
module.exports = {
theme: {
// ...
},
extend: {
minWidth: (theme) => ({
...theme('spacing')
}),
@PaulMorel
PaulMorel / gist:aefd2ebfe5bef89868da90a068facf8b
Created August 13, 2020 12:38
Unicode ranges for English and French
unicode-range: U+0020-007E, U+00A2, U+00A3, U+00A5, U+00A8, U+00A9, U+00AB, U+00AE, U+00B4, U+00B8, U+00BB, U+00C0, U+00C2, U+00C6-00CB, U+00CE, U+00CF, U+00D4, U+00D9, U+00DB, U+00DC, U+00E0, U+00E2, U+00E6-00EB, U+00EE, U+00EF, U+00F4, U+00F9, U+00FB, U+00FC, U+00FF, U+0152, U+0153, U+0178, U+02C6, U+02DA, U+02DC, U+2013, U+2014, U+2018, U+2019, U+201A, U+201C, U+201D, U+201E, U+2022, U+2026, U+2039, U+203A, U+20AC, U+2122;
@PaulMorel
PaulMorel / composer.js
Created August 9, 2020 23:29
WordPress Composer Starter
{
"name": "project",
"repositories":[
{
"type":"composer",
"url":"https://wpackagist.org"
},
{
"type": "package",
"package": {
@PaulMorel
PaulMorel / .gitignore
Created March 9, 2020 21:50
Wordpress gitignore
!.gitignore
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except: "themes" directory
wp-content/*
!wp-content/themes/
@PaulMorel
PaulMorel / wordpress-json-sitemap.php
Last active September 5, 2019 23:29
Create an endpoint for a generated JSON site map of every post, page, post-type, etc.
<?php
/**
* Create an endpoint for a generated JSON site map of every post, page, post-type, etc.
*
* @return void
*/
function json_sitemap() {
global $wp;
@PaulMorel
PaulMorel / functions.php
Created April 12, 2019 20:04
Adding The SEO Framework Social Media fields to your Timber context for Wordpress
<?php
/**
* Add the SEO Framework's social media fields to the Timber context
*
* @param array $context Timber's context
*
* @return array
*/
function timber_add_seo_framework_social( $context ) {
@PaulMorel
PaulMorel / gulpfile.js
Created June 20, 2018 14:17
Gulp SVG Sprite
var config = {
basePath: {
src: 'assets/',
}
};
var svgsprite = require('gulp-svg-sprite');
function sprite() {
return gulp.src(