- 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
- Add the manifest key to "key" in manifest.json
- Create a new project in Google Developer Console https://console.developers.google.com/project
- Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
- Copy the Client ID to oauth2.client_id in the manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'] . '://'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |