Skip to content

Instantly share code, notes, and snippets.

building fun things

Owen Williams ow

building fun things
View GitHub Profile
View Samsung Smart-TV Blocklist Adlist (for PiHole)
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
hypeJunction / refund.php
Last active May 17, 2022
Stripe Subscription Cancellation and Prorated Refund
View refund.php
class StripeSubscriptionHandler {
* Cancel a Stripe subscription, optionally prorating and refunding the unused amount
* @param string $id Stripe Subscription ID
* @param bool $at_period_end Type of cancellation
* If set to true, will cancel the subscription at its end
rjcaya /
Last active Mar 15, 2022
Laravel Homestead per Project Installation on Windows 10
  • Php7
  • Composer
  • Gulp
  • Npm
  • Vagrant
  • Virtual Box
  • Laravel Installer
joshuabaker / general.php
Created Jul 14, 2015
CloudFlare compatible config for Craft CMS.
View general.php
if (isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'],'on') === 0 || $_SERVER['HTTPS'] == 1))
$protocol = 'https://';
else if ( ! empty($_SERVER['HTTP_X_FORWARDED_PROTO']))
$protocol = $_SERVER['HTTP_X_FORWARDED_PROTO'] . '://';
raineorshine /
Last active Aug 10, 2022
How to set up user authentication for a Chrome Extension using the Chrome Identity API

How to set up user authentication for a Chrome Extension using the Chrome Identity API

  1. Create a private key file, from which you can create the manifest key and Application ID, as detailed here:
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console
  4. Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
  5. Copy the Client ID to oauth2.client_id in the manifest.json


johanneslamers / craftcms_varnish.vcl
Last active Feb 26, 2019 — forked from aelvan/gist:eba03969f91c1bd51c40
Varnish 4.0 file for our Craft CMS projects
View craftcms_varnish.vcl
# Varnish 4.0 file for our Craft CMS projects
# Based on
# This is still work in progress, comments appreciated.
vcl 4.0;
import std;
import directors;
nicktoumpelis /
Created Apr 23, 2014
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
brandonkelly / gist:8149062
Last active Jul 30, 2018
Saving new Matrix data
View gist:8149062
// Get the entry
$entry = craft()->entries->getEntryById(100);
// Convert the existing data to what it would look like in POST
$matrixData = array();
foreach ($entry->matrixField as $block)
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /