Skip to content

Instantly share code, notes, and snippets.

View brycehamrick's full-sized avatar

Bryce Hamrick brycehamrick

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!--
Salesforce.com Partner Web Services API Version 24.0
Generated on 2012-06-01 21:30:10 +0000.
Copyright 1999-2012 salesforce.com, inc.
All Rights Reserved
@brycehamrick
brycehamrick / CaptureCanRedeem
Created August 16, 2012 01:07
Capture Promo Creation
public bool CaptureCanRedeem(string barcode, out bool alreadyExist)
{
alreadyExist = false;
query.Add("type_name", "promos");
query.Add("attributes", "{\"code\":\"" + barcode + "\"}");
query.Add("client_id", client_id);
query.Add("client_secret", client_secret);
JObject obj = GetData("https://loccitane.janraincapture.com/entity.create", query);
if (obj["stat"] != null && obj["stat"].Value<string>() == "error" && obj["error"] != null && obj["error"].Value<string>() == "unique_violation")
alreadyExist = true;
@brycehamrick
brycehamrick / backplane_ready.js
Last active December 12, 2015 00:38
Backplane ready callback
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
/**
* Callback function to be executed on BP ready
*/
function bp_ready_callback() {
// Code to be executed on BP ready
}
@brycehamrick
brycehamrick / backplane_channel.js
Last active December 12, 2015 00:38
Pass the Backplane channel ID to the server via JSONP
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
/**
* Callback function to be executed on BP ready
*/
function bp_ready_callback() {
// Get the channel ID
var bpChannel = Backplane.getChannelID();
@brycehamrick
brycehamrick / backplane_subscribe_switch_send.js
Last active December 12, 2015 01:39
Subscribing to a Backplane channel and testing type, then sending the messageURL to a server.
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
/**
* Callback function to be executed on BP ready
*/
function bp_ready_callback() {
Backplane.subscribe(function(message){
switch(message.type) {
@brycehamrick
brycehamrick / backplane_subscribe.js
Last active December 12, 2015 01:49
Subscribe to Backplane messages
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
/**
* Callback function to be executed on BP ready
*/
function bp_ready_callback() {
Backplane.subscribe(function(message){
// Do something with message
@brycehamrick
brycehamrick / backplane_subscribe_switch.js
Last active December 12, 2015 01:49
Subscribing to a Backplane channel and testing type
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
/**
* Callback function to be executed on BP ready
*/
function bp_ready_callback() {
Backplane.subscribe(function(message){
switch(message.type) {
@brycehamrick
brycehamrick / backplane_version.js
Created February 1, 2013 21:52
Test for Backplane and Backplane Version
(function() {
if (typeof window.Backplane !== 'function' || parseInt(Backplane.version) !== 2)
return;
// Backplane code
})();
@brycehamrick
brycehamrick / backup.sh
Created February 12, 2013 18:42
Shell script & PHP script to backup a wordpress instance to a Box account
#! /bin/bash
echo Backup Started `date` >> ~/backups/backup.log
mkdir ~/backups/data/`date +%Y%m%d`
tar -czf ~/backups/data/`date +%Y%m%d`/`date +%Y%m%d`_wp3.tar.gz ~/wp3
mysqldump -uwp3 -ppassword wp3 > ./wp3.sql
tar -czf ~/backups/data/`date +%Y%m%d`/`date +%Y%m%d`_sql.tar.gz ./wp3.sql
rm ./wp3.sql
find ~/backups/data -mtime +20 -type f -exec rm -rf {} \;
echo Backup Completed `date` >> ~/backups/backup.log
@brycehamrick
brycehamrick / hoodie-debug.txt
Created February 18, 2014 19:28
hoodie debug
This file has been truncated, but you can view the full file.

.d$b. .d$b. .d$$$$$$b.  .d$$$$$$b. .d$$$$$$b. .d$b..d$$$$$$$$b.
$$$$$..$$$$$.$$$$$$$$$$$b .$$$$$$$$$$$b $$$$$$$$$$b $$$$$$$$$$$$$$$P'
$$$$$$$$$$$$d$$$$$$$$$$$$bd$$$$$$$$$$$$b$$$$$$$$$$$b$$$$$$$$$$$$$$$b.
$$$$$$$$$$$$Q$$$$$$$$$$$$PQ$$$$$$$$$$$$P$$$$$$$$$$$P$$$$$$$$$$$$$$$P'
$$$$$´`$$$$$'$$$$$$$$$$$$''$$$$$$$$$$$$'$$$$$$$$$$P $$$$$$$$$$$$$$$b.
'Q$P' 'Q$P' 'Q$$$$$$P'  'Q$$$$$$P' 'Q$$$$$$$P