Skip to content

Instantly share code, notes, and snippets.

Avatar
🎊
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.
abtauthprd.samsungcloudsolution.com
acr0.samsungcloudsolution.com
ad.samsungadhub.com
ads.samsungads.com
amauthprd.samsungcloudsolution.com
api-hub.samsungyosemite.com
@hypeJunction
hypeJunction / refund.php
Last active Jun 15, 2020
Stripe Subscription Cancellation and Prorated Refund
View refund.php
<?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
rjcaya / laravel-per-project-installation.md
Last active Jun 11, 2020
Laravel Homestead per Project Installation on Windows 10
View laravel-per-project-installation.md
Prerequisite:
  • Php7
  • Composer
  • Gulp
  • Npm
  • Vagrant
  • Virtual Box
  • Laravel Installer
@joshuabaker
joshuabaker / general.php
Created Jul 14, 2015
CloudFlare compatible config for Craft CMS.
View general.php
<?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
raineorshine / _chrome-ext-auth-identity.md
Last active Nov 27, 2021
How to set up user authentication for a Chrome Extension using the Chrome Identity API
View _chrome-ext-auth-identity.md

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: https://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console https://console.developers.google.com/project
  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

Deprecated?

@johanneslamers
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 https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
#
# This is still work in progress, comments appreciated.
vcl 4.0;
import std;
import directors;
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created Apr 23, 2014
Cleans and resets a git repo and its submodules
View repo-rinse.sh
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
brandonkelly / gist:8149062
Last active Jul 30, 2018
Saving new Matrix data
View gist:8149062
<?php
// 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
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/