Skip to content

Instantly share code, notes, and snippets.

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

Jean Pierre Kolb JPKCom

🏠
Working from home
View GitHub Profile
@JPKCom
JPKCom / getenv.php
Created November 14, 2023 14:17
Simple .env connector
<?php
if ( !function_exists( 'jpkcom_getenv' ) ) {
if ( file_exists( dirname(__FILE__) . '/.env' ) ) {
$lines = file( dirname(__FILE__) . '/.env' );
foreach ( $lines as $line ) {
@JPKCom
JPKCom / functions.php.php
Created April 3, 2023 14:24 — forked from blogjunkie/functions.php.php
Add custom fonts to Elementor from your theme
<?php // Don't include this line
/**
* Add new font group (Custom) to the top of the list
*/
add_filter( 'elementor/fonts/groups', function( $font_groups ) {
$new_font_group = array( 'custom' => __( 'Custom' ) );
return array_merge( $new_font_group, $font_groups );
} );
@JPKCom
JPKCom / nginx.conf
Created September 30, 2021 08:50
NGINX basic security headers
add_header Content-Security-Policy "upgrade-insecure-requests" always;
add_header Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'self'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'self'; midi 'none'; payment 'self'; picture-in-picture 'self'; speaker 'self'; sync-xhr 'self'; usb 'none'; vr 'none'" always;
add_header Permissions-Policy "accelerometer=(none), ambient-light-sensor=(none), autoplay=(self), camera=(none), encrypted-media=(self), fullscreen=(self), geolocation=(none), gyroscope=(none), magnetometer=(none), microphone=(self), midi=(none), payment=(self), picture-in-picture=(self), speaker=(self), sync-xhr=(self), usb=(none), vr=(none), interest-cohort=()" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-D
@JPKCom
JPKCom / plink-plonk.js
Created February 17, 2020 07:36 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@JPKCom
JPKCom / chromium_update.sh
Created November 6, 2018 13:49 — forked from Superbil/chromium_update.sh
auto update chromium on osx
#!/bin/bash
# Chromium update script
# - by shad <shad@zaphod.eu>
# - by superbil <help@superbil.info>
OS=mac
SITE=http://build.chromium.org/buildbot/snapshots/chromium-rel-
LATEST=$(wget -q -O - ${SITE}${OS}/LATEST)
INSTALL_DIR=/Applications
TARGET=Chromium
@JPKCom
JPKCom / ramdisk-howto.md
Created April 19, 2018 06:18 — forked from dhlavaty/ramdisk-howto.md
Create RAM disk in macOS High Sierra (10.13.3)

Create RAM disk in macOS High Sierra (10.13.3)

LIST DISKS

$ diskutil list

RAMDISK CREATE

Keybase proof

I hereby claim:

  • I am jpkcom on github.
  • I am jpkcom (https://keybase.io/jpkcom) on keybase.
  • I have a public key ASBD3ijZFv23dYO0feXCbba9azKXpEJWAaXK2PfiiiJv9Ao

To claim this, I am signing this object:

@JPKCom
JPKCom / CssServer.php
Created May 2, 2017 09:26 — forked from dstorozhuk/CssServer.php
Extends the Leafo\ScssPhp\Server. Add source map. Part of Drupal 8 module.
<?php
/**
* Created by PhpStorm.
* User: dima
* Date: 11/12/16
* Time: 11:58 AM
*/
namespace Drupal\bootstrap_sass_helper;
@JPKCom
JPKCom / gist:5854207a20087c1b2489212fb9a1edf2
Created July 25, 2016 09:32 — forked from robdvr/gist:7451695
Adding Bootstrap Forms to WooCommerce
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields( $fields ) {
$fields['billing_address_1']['class'] = array( 'form-group' );
$fields['billing_address_1']['input_class'] = array( 'form-control' );
return $fields;
}
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml