Skip to content

Instantly share code, notes, and snippets.

View flexgrip's full-sized avatar

Raymond Aguilar flexgrip

View GitHub Profile
@flexgrip
flexgrip / services_from_drupal.js
Last active December 22, 2015 13:58
Get data from Drupal Services rest server to the Intel XDK. Yeah yeah yeah.
/*
_ _ _______ ______
| \ | | ____\ \ / / ___|
| \| | _| \ \ /\ / /\___ \
| |\ | |___ \ V V / ___) |
|_| \_|_____| \_/\_/ |____/
================================*/
function getBlog() {
// Pull the curtain
<ul class="lb-my-images unstyled">
<li class="default-image">
<a href="#" class="img-choose-btn">
<img src="https://d723-leadbox-redesign-dot-leadpage-test.appspot.com/static/lp702/img/leadbox-image-placeholder.png">
</a>
</li>
<li class="my-images"><a href="#" class="image-choose-btn"><img alt="Image" src="https://lh4.ggpht.com/QccS17iRxed2xgpap17IeP3qx8DshmBH-OrdGcFqxJjfprMWo6oPDk1l3KaXw3PkGCBS26QEh-PItlbqQYLLcG1t=s100"></a></li>
@flexgrip
flexgrip / functions.js
Created August 18, 2014 19:43
LeadPages Template fade-in box and facebook comments syntax
// Add this placeholder to functions.js so it can hold
// the leadpages_input_data variable.
var leadpages_input_data = {};
elif request == 'registration-status':
rid = self.request.POST.get('reg_id')
reg = Registration.get_by_id(int(rid))
if not reg:
body = {'status': 'error', 'message': 'Registration failed!'}
if reg.status == 'finished':
account = reg.account.get()
plan_type = 'standard'
if account.is_pro:
plan_type = 'pro'
$(document).ready(function() {
var e = new Array;
e[0] = "bastards";
e[1] = "fakes";
e[2] = "mongrels";
e[3] = "phonies";
e[4] = "shams";
e[5] = "sharks";
e[6] = "swindlers";
e[7] = "jerks";
@flexgrip
flexgrip / svn-example.svg
Created June 4, 2015 17:11
What XML looks like in an SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[{"nid":[{"value":"1"}],"uuid":[{"value":"2fad4156-76f0-43d3-8500-aa5420cb480a"}],"vid":[{"value":"1"}],"type":[{"target_id":"book"}],"langcode":[{"value":"en"}],"title":[{"value":"A Clockwork Orange"}],"uid":[{"target_id":"1","url":"\/user\/1"}],"status":[{"value":"1"}],"created":[{"value":"1455223069"}],"changed":[{"value":"1455223135"}],"promote":[{"value":"0"}],"sticky":[{"value":"0"}],"revision_timestamp":[{"value":"1455223124"}],"revision_uid":[{"target_id":"1","url":"\/user\/1"}],"revision_log":[],"revision_translation_affected":[{"value":"1"}],"default_langcode":[{"value":"1"}],"path":[],"body":[{"value":"<p>A Clockwork Orange takes place in a futuristic city governed by a repressive, totalitarian super-State. In this society, ordinary citizens have fallen into a passive stupor of complacency, blind to the insidious growth of a rampant, violent youth culture. The protagonist of the story is Alex, a fifteen-year-old boy who narrates in a teenage slang called nadsat, which incorporates elements of Russi
[Day 2 of trying to resolve marketing API bug...]
ray@ave81.com
(651) 200-9755
Hello all,
My name is Raymond Aguilar. I'm the head engineer at LeadPages™. For a little background, we make a landing page builder and optin-form generator called LeadBoxes™ which are widely used in the marketing industry.
Many of our top-level enterprise customers integrate their marketo accounts with our service so that anyone who fills out their capture forms are uploaded directly to their marketo account.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "leadpages.net"}{
HTTP::respond 301 Location "https://www.leadpages.net[HTTP::uri]"
}
if { [string tolower [HTTP::uri]] starts_with "/blog" }{
node 104.193.18.59
}
@flexgrip
flexgrip / StripePullByDate.php
Last active August 30, 2016 00:04
StripePullByDate.php
while ($charges['has_more']) {
$charges = $stripe->getChargesByDate($start_date, $starting_after);
foreach($charges["data"] as $charge) {
// DEBUG
Log::info($charges['has_more']);
// Reset the data for the pager. Have to do this first in case we skip a dirty record.
$starting_after = $charge['id'];