Skip to content

Instantly share code, notes, and snippets.

View flexgrip's full-sized avatar

Raymond Aguilar flexgrip

View GitHub Profile
@flexgrip
flexgrip / Webview.php
Created October 4, 2018 16:06
Botman Messenger Webview
<?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 September 21, 2018 20:50
types and waits on originated and replies
<?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 September 2, 2018 16:03
Generic template function from bothelpers.php
<?php
/*
* Generic template
*/
public function buildMessageTemplateGeneric($message) {
# WORKS
$template = GenericTemplate::create()
->addElement(
Element::create($message->attachment->title)
->image($message->attachment->payload->url)
@flexgrip
flexgrip / example_esp8266.h
Created March 31, 2017 20:17
Example esp8266
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 January 23, 2017 21:11
Full directory structure of my EFI partition
.
├── EFI
│   ├── APPLE
│   │   ├── EXTENSIONS
│   │   │   └── Firmware.scap
│   │   ├── FIRMWARE
│   │   │   └── IM142_0118_B14_LOCKED.scap
│   │   └── UPDATERS
│   │   └── SMC
│   │   ├── Mac-27ADBB7B4CEE8E61.epm
@flexgrip
flexgrip / get_rhs.sh
Created January 17, 2017 22:04
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.
#!/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 January 13, 2017 19:55
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.
/**
* 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 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'];
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
}
[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.