Skip to content

Instantly share code, notes, and snippets.

View scottgruber's full-sized avatar

Scott Gruber scottgruber

View GitHub Profile
@brendandawes
brendandawes / ifttt.php
Last active March 24, 2018 17:33
Script for use with IFTTT to automate making Kirby blog posts from Instagram
<?php
require($_SERVER['DOCUMENT_ROOT'] . '/kirby/bootstrap.php');
// Path to a configuration file outside of a web accesible directory containing your secret pass phrase and salt.
include '/Path/To/Your/conf.inc';
if(get('id').$SALT==$IFTTT_PASS.$SALT) {
@Jany-M
Jany-M / wp_ics.php
Last active September 19, 2023 03:15 — forked from jakebellacera/ICS.php
[WP] Generate a downloadable .ics file from any WordPress post or custom post type
<?php
/*
For a better understanding of ics requirements and time formats
please check https://gist.github.com/jakebellacera/635416
*/
// UTILS
// Check if string is a timestamp
@seoagentur-hamburg
seoagentur-hamburg / clean-header.php
Created February 23, 2016 19:01
Den Header von WordPress bereinigen
<?php
//emoji aus dem header entfernen
function disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
@greenboyroy
greenboyroy / glossary.php
Last active October 28, 2017 06:03
Using Perch to create an alphabet of links for a collection or list/detail page.
<main role="main" class="glossary">
<div class="group">
<?php
// setup alphabet array for navigation
// make array of letters in span tags
$nav_arr = array(
'0-9' => '<span>0-9</span>'
);
for ($i = 65; $i <= 90; $i++) {
$nav_arr[chr($i)] = '<span>'.chr($i).'</span>';
@pascalbaljet
pascalbaljet / imagick-3.4.0-PHP7-forge.sh
Last active November 26, 2020 09:10
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
@ozinepank
ozinepank / Padding-Hack.css
Last active November 30, 2022 15:39
The Padding-Bottom Hack
.img-container {
position: relative;
padding-bottom: 56.25%; /* 16:9 ratio */
height: 0;
overflow: hidden;
}
.img-container img {
position: absolute;
top: 0;
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
function postToMedium($data=array()) {
$user_id = "XXXX";
$accessToken = "XXXX";
@adactio
adactio / ampify.php
Last active October 3, 2022 06:26
Make a chunk of markup AMP-ready
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
function ampify($html='') {
# Replace img, audio, and video elements with amp custom elements
$html = str_ireplace(
['<img','<video','/video>','<audio','/audio>'],
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="leaflet-providers.js"></script>
</head>
<body>
<div id="map" style="width: 100%; height: 300px;"></div>
<script type="text/javascript">
@kevinSuttle
kevinSuttle / VS Code settings.json
Last active September 16, 2022 09:44
Visual Studio Code Settings
{
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14,
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"editor.wordWrap": "on",
"flow.useNPMPackagedFlow": true,
"javascript.format.enable": false,
"javascript.validate.enable": false,