Skip to content

Instantly share code, notes, and snippets.

View lucien144's full-sized avatar
🤘
Refactor!

lucien144

🤘
Refactor!
View GitHub Profile
@lucien144
lucien144 / seo.php
Last active June 16, 2021 12:01
Wordpress ACF for custom SEO
<?php
// Mandatory ACF plugin: https://wordpress.org/plugins/acf-code-field/
if( function_exists('acf_add_local_field_group') ):
acf_add_local_field_group(array(
'key' => 'group_5b9a038a203dd',
'title' => 'SEO Settings',
'fields' => array(
array(
@lucien144
lucien144 / colors.scss
Last active April 8, 2021 17:23
Colors
// Dark solid setup
$dark-050: rgba(230, 235, 236, 1) !default;
$dark-100: rgba(205, 215, 216, 1) !default;
$dark-150: rgba(179, 195, 197, 1) !default;
$dark-200: rgba(154, 175, 177, 1) !default;
$dark-250: rgba(129, 155, 158, 1) !default;
$dark-300: rgba(104, 134, 139, 1) !default;
$dark-350: rgba(79, 114, 119, 1) !default;
$dark-400: rgba(53, 94, 100, 1) !default;
$dark-450: rgba(28, 74, 80, 1) !default;
@lucien144
lucien144 / mercator.dart
Last active January 9, 2020 16:12
Class to convert pixels & GPS coords and back for PHP and DART
/**
* https://stackoverflow.com/a/41527934/4026345
*/
import 'dart:math';
import 'package:flutter/painting.dart';
class MercatorProjection {
final DEFAULT_PROJECTION_WIDTH = 256; // ignore: non_constant_identifier_names
@lucien144
lucien144 / bitbucket-pipelines.yml
Last active March 14, 2022 20:30
Bitbucket Pipeline to Ubuntu server via bash script
image: atlassian/default-image:2
pipelines:
branches:
master:
- step:
deployment: production
script:
- cat ./deploy.sh | ssh $HOST_USER@$HOST_URL
- echo "Deploy step finished"
@lucien144
lucien144 / package.json
Last active October 25, 2018 23:32
Vue with XO
// The XO has to be installed as dependency. If you use it globally, it won't work...
"xo": {
"extensions": [
"vue"
],
"parserOptions": {
"parser": "babel-eslint"
},
"extends": [
"plugin:vue/recommended"
@lucien144
lucien144 / index.php
Last active December 11, 2018 04:32
Adminer self-update
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";
// autoloader
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}
@lucien144
lucien144 / mixins.less
Last active March 15, 2018 23:46
LESS mixins
/**
* Layout mixins
*/
.top-left(@top: 0, @left: 0, @zindex: '', @position: absolute) when (@zindex = '') {
position: @position;
top: @top;
left: @left;
}
.top-left(@top: 0, @left: 0, @zindex: '', @position: absolute) when not (@zindex = '') {
@lucien144
lucien144 / vue.min.js
Created February 28, 2018 06:05
vue.min.js
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(t){return void 0===t||null===t}function e(t){return void 0!==t&&null!==t}function n(t){return!0===t}function r(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function i(t){return null!==t&&"object"==typeof t}function o(t){return"[object Object]"===Nn.call(t)}function a(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function s(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function c(t){var e=parseFloat(t);return isNaN(e)?t:e}function u(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}function l(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}function f(t,e){return Mn.call(t,e)}function p(t){var e=Object.create
@lucien144
lucien144 / create-database-collection.sh
Last active February 1, 2018 05:54
Basic MongoDB commands
# Create new database & new collection
use new_db
db.new_db.save({test: 'test'});
@lucien144
lucien144 / cache-clear.sh
Last active July 20, 2024 20:36
Clear Cloudflare cache from command line.
#!/bin/bash
curl -X POST "https://api.cloudflare.com/client/v4/zones/{$ZONE_ID}/purge_cache" \
-H "X-Auth-Email: {$EMAIL}" \
-H "X-Auth-Key: {$API_KEY}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'