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
*filter | |
:INPUT DROP [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
# Accept all loopback traffic | |
-A INPUT -i lo -j ACCEPT | |
# Drop invalid/unknown/spoofed TCP sessions | |
-A INPUT -p tcp ! --syn -m state --state NEW -j DROP |
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); | |
// Define the new Matrix data | |
$matrixData = array( | |
'1' => array( // '1' is an existing block ID | |
'type' => 'text', // 'text' is the block type handle | |
'enabled' => true, |
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 | |
public function getEntryJson(EntryModel $entry) | |
{ | |
$entryData = array(); | |
foreach ($entry->getType()->getFieldLayout()->getFields() as $field) | |
{ | |
$field = $field->getField(); | |
$handle = $field->handle; |
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
curl 'https://api.shipengine.com/v1/labels' -X POST \ | |
-H "Content-type: application/json" \ | |
-H "api-key: dmtzyBFq9DsGMGd1GkzHilzeEAKsyyRyxQH3cz7M+Lo" \ | |
-d ' | |
{ | |
"shipment": { | |
"service_code": "usps_priority_mail", | |
"ship_to": { | |
"name": "Dade Murphy", | |
"phone": "+1 (212) 555-5555", |
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
curl 'https://api.shipengine.com/v1/rates' -X POST \ | |
-H "Content-type: application/json" \ | |
-H "api-key: dmtzyBFq9DsGMGd1GkzHilzeEAKsyyRyxQH3cz7M+Lo" \ | |
-d ' | |
{ | |
"shipment": { | |
"ship_to": { | |
"name": "Dade Murphy", | |
"phone": "+1 (212) 555-5555", | |
"company_name": "Zero Cool", |
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
curl 'https://api.shipengine.com/v1/addresses/validate' -X POST \ | |
-H "Content-Type: application/json" \ | |
-H "api-key: dmtzyBFq9DsGMGd1GkzHilzeEAKsyyRyxQH3cz7M+Lo" \ | |
-d ' | |
[ | |
{ | |
"name": "Dade Murphy", | |
"phone": "+1 (212) 555-5555", | |
"company_name": "Zero Cool", | |
"address_line1": "345 Chambers Street", |
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
curl 'https://api.shipengine.com/v1/tracking?carrier_code=stamps_com&tracking_number=9405511899223197428490' -X GET \ | |
-H "Content-type: application/json" \ | |
-H "api-key: dmtzyBFq9DsGMGd1GkzHilzeEAKsyyRyxQH3cz7M+Lo" |
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
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('a').each(function() { | |
var href = $(this).attr('href'); | |
if (href !== undefined) { | |
if (href.indexOf('?') == -1) { | |
var url = document.URL; | |
var index = url.indexOf('?'); | |
if (index != -1) { | |
url = url.substring(index); |