Skip to content

Instantly share code, notes, and snippets.

@AustinHay
AustinHay / Set Braze Default Permissions
Last active October 27, 2020 18:53
A simple JS script to set standard operating permissions in the Braze UI.
// *=====================================================================================================* //
function set_default_permissions() {
// Set the user to Limited User so that the options below show.
window.document.getElementsByClassName("developer-role-select")[0].value = "Limited"
$('.developer-role-select').change(function(){
var data= $(this).val();
});
$('.developer-role-select')
.val('"Limited"')
@AustinHay
AustinHay / bncExportAPIScript.rb
Created May 11, 2017 00:40
Export API Download Script
#!/usr/bin/ruby
# HBE Ventures, LLC 2017
# Austin Hay
# austin@hbe.io
#########################################
# Ruby Dependencies
require 'net/http'
require 'uri'
require 'open-uri'
“{
“+is_first_session”:true,
”+clicked_branch_link”:true,
”$android_url”: ”https://dl.dropboxusercontent.com/u/53000535/Branch/pg_partner_repos/Foursquare%2BSwarm/foursquare-banner.html",
"$desktop_url":"https://dl.dropboxusercontent.com/u/53000535/Branch/pg_partner_repos/Foursquare%2BSwarm/foursquare-banner.html",
"$ios_url":"https://dl.dropboxusercontent.com/u/53000535/Branch/pg_partner_repos/Foursquare%2BSwarm/foursquare-banner.html",
"$marketing_title":"Facebook Test Marketing Link”,”$one_time_use”:false,”~campaign”:”Free Food”,”~channel”:”Facebook”,”~creation_source”:”Dashboard”,”~feature”:”marketing”,”~id”:”266934882054321721",
”~marketing”:true,
”~tags”:[
“june”
@AustinHay
AustinHay / gist:adad98020d25a32035b900bd6ea96373
Last active October 2, 2016 19:33
Branch Web SDK - branch.init()
<script type="text/javascript">
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode banner closeBanner creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode".split(" "), 0);
branch.init('BRANCH KEY', function(err, data) {
// callback to handle err or data
console.log(data) // Log the data to your console so you can inspect it!
});
</script>
@AustinHay
AustinHay / Branch Web SDK - Full Sample Code | Your Website as Your Mobile App Attribution Hub
Last active October 2, 2016 19:41
An example of how to use the Web SDK to grab referring parameter data and apply it to other branch calls, like branch.banner()
<html>
<head>
<script type="text/javascript">
// Grab pathname from URL and parse into the URI for Vevo
var url = window.location.href;
var channel = 'Mobile Web';
var feature = 'App Banner';
var campaign = null;
var referring_data = null;
@AustinHay
AustinHay / branch.smartbanner.1.8.2016.js
Last active January 27, 2016 00:29
Branch Smart Banner - Jan 2016
<script type="text/javascript">
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-v1.8.4.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode banner closeBanner creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setIdentity track validateCode".split(" "), 0);
branch.init('YOUR-BRANCH-KEY');
branch.banner({
icon: 'http://icons.iconarchive.com/icons/wineass/ios7-redesign/512/Appstore-icon.png',
title: 'Branch Demo App',
description: 'The Branch demo app!'
}, {});
</script>