Skip to content

Instantly share code, notes, and snippets.

View trockendock's full-sized avatar

Pascal Müller trockendock

  • Riwers
  • Switzerland
  • 06:18 (UTC +02:00)
View GitHub Profile
@afiqiqmal
afiqiqmal / FeedSample.php
Last active September 3, 2018 13:58
Get Facebook Page Feed with PHP + Guzzle
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
require_once __DIR__ .'/../vendor/autoload.php';
use Dotenv\Dotenv;
// load envirionment variable
// add this package in your composer.json if want to use dotenv "vlucas/phpdotenv"
@PostCucumber
PostCucumber / FacebookFeed.php
Last active September 3, 2018 13:58
Facebook module for Wordpress
<?php
use GuzzleHttp\Client;
class FacebookFeed
{
/**
* @param int $limit
* @return array
*/
public function fetch($limit = 5)
{
@indikatordesign
indikatordesign / functions.php
Last active July 26, 2023 15:05
[WooCommerce Subscriptions]Disallow downgrading for "WooCommerce Subscriptions" Grouped Product-Subscriptions
<?php
// Prevent Downgrading
add_filter( 'woocommerce_subscriptions_switch_is_identical_product', function( $is_identical_product, $product_id, $quantity, $variation_id, $subscription, $item )
{
if ( wc_get_product( (int) $product_id )->get_price() < $item->get_product()->get_price() )
{
$is_identical_product = true;
@zeshanshani
zeshanshani / polylang_custom_language_switcher.css
Last active February 19, 2023 06:12
Custom Language Switcher for Polylang. Contains both the PHP function and SCSS styling. HTML markup is using BEM methodology. SCSS file is using my variables and mixins from here: https://gist.github.com/zeshanshani/c4d5ae43e6a9f661d012
/* Component: Languages */
.languages__item {
text-transform: uppercase;
color: #899099;
font-size: 13px;
font-size: 1.3rem;
line-height: 1.15;
}
.languages__item--current {
color: #212121;
@noelboss
noelboss / git-deployment.md
Last active May 12, 2025 18:08
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 15, 2025 16:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@miklb
miklb / functions.php
Created April 5, 2012 15:16
Add Pdf and Word Doc filtering to WordPress Media Library
/**
* add custom "mime types" (file supertypes)
* @param array $post_mime_types
* @return array
*/
function filterPostMimeTypes($post_mime_types) {
$post_mime_types['application/pdf'] = array('PDF', 'Manage PDFs', _n_noop('PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>'));
$post_mime_types['application/msword'] = array('Word Docs', 'Manage Word Docs', _n_noop('Word DOC <span class="count">(%s)</span>', 'Word Docs <span class="count">(%s)</span>'));
return $post_mime_types;
}