Skip to content

Instantly share code, notes, and snippets.

Avatar

Raymond Aguilar flexgrip

View GitHub Profile
@flexgrip
flexgrip / Webview.php
Created Oct 4, 2018
Botman Messenger Webview
View Webview.php
<?php
$template = ButtonTemplate::create($message->attachment->payload->text);
Log::info('Inside the button template1';
$template->addButton(
ElementButton::create($btn->title)
->url(
$webview_url.'/adAudit/'.$this->optin->id.'/'.$delivery->fresh()->uuid
)
->heightRatio(ElementButton::RATIO_FULL)
->enableExtensions());
@flexgrip
flexgrip / types_and_waits.php
Created Sep 21, 2018
types and waits on originated and replies
View types_and_waits.php
<?php
public function sendTypesAndWaits($seconds) {
Log::info('Send typesAndWaits');
$response = $this->bot->sendRequest('me/messages', [
'recipient' => $this->recipient,
'sender_action' => 'typing_on'
]);
@flexgrip
flexgrip / BotHelpers.php
Created Sep 2, 2018
Generic template function from bothelpers.php
View BotHelpers.php
<?php
/*
* Generic template
*/
public function buildMessageTemplateGeneric($message) {
# WORKS
$template = GenericTemplate::create()
->addElement(
Element::create($message->attachment->title)
->image($message->attachment->payload->url)
View example_esp8266.h
client.println("POST /posts HTTP/1.1");
client.println("Host: jsonplaceholder.typicode.com");
client.println("Cache-Control: no-cache");
client.println("Content-Type: application/x-www-form-urlencoded");
client.print("Content-Length: ");
client.println(PostData.length());
client.println();
client.println(PostData);
long interval = 2000;
@flexgrip
flexgrip / efi_directory_tree.sh
Created Jan 23, 2017
Full directory structure of my EFI partition
View efi_directory_tree.sh
.
├── EFI
│   ├── APPLE
│   │   ├── EXTENSIONS
│   │   │   └── Firmware.scap
│   │   ├── FIRMWARE
│   │   │   └── IM142_0118_B14_LOCKED.scap
│   │   └── UPDATERS
│   │   └── SMC
│   │   ├── Mac-27ADBB7B4CEE8E61.epm
@flexgrip
flexgrip / get_rhs.sh
Created Jan 17, 2017
Grabs all of the rhs mods from the workshop onto a linux server with steamcmd installed. Make sure you auth steamcmd with the user you specify at least once before running or it will fail.
View get_rhs.sh
#!/bin/bash
declare -A PACK
# EDIT THESE
#
# choose which packs you want to get by uncommenting them
PACK[afrf]=843425103
#PACK[usaf]=843577117
#PACK[gref]=843593391
#PACK[saf]=843632231
@flexgrip
flexgrip / pass-parameters-with-hubspot-forms.js
Created Jan 13, 2017
Pass the GET parameters / url variables / query string, from a hubspot form to your redirect/thank-you page. Apparently, to do this now, you have to manually define the redirect url in the script. It's not exposed in hsContext anymore.
View pass-parameters-with-hubspot-forms.js
/**
* Append the form data from a HubSpot form automatically
* to the redirect URL query parameters. These values can
* then be used on the form to modify the user experience
* of the Thank You page
*
* LICENSE
* Form redirect
* Written in 2015 by Mike Axiak <maxiak@hubspot.com>
* Updated in 2016 by Seth Meranda <seth.meranda@cune.edu>
@flexgrip
flexgrip / StripePullByDate.php
Last active Aug 30, 2016
StripePullByDate.php
View 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'];
View irule lpnet v5
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
}
View email_to_marketo
[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.