Skip to content

Instantly share code, notes, and snippets.

View developersteve's full-sized avatar

developersteve developersteve

View GitHub Profile
@developersteve
developersteve / app.rb
Created March 18, 2019 04:31
TelstraDev messaging ruby app example
require 'Telstra_Messaging'
api_instance = Telstra_Messaging::AuthenticationApi.new
client_id = 'Secret' # String |
client_secret = 'key' # String |
grant_type = 'client_credentials' # String |
result = api_instance.auth_token(client_id, client_secret, grant_type)
@developersteve
developersteve / callback
Created September 17, 2018 22:44
SMS broker callback
<?php
require_once(__DIR__ . '/vendor/autoload.php');
require_once(__DIR__ . '/inc.php');
require("phpMQTT.php");
$server = "iot.broker.com";
$port = 1883;
$username = "";
$password = "";
/****************************************
* Include Libraries
****************************************/
#include <Adafruit_NeoPixel.h>
#include <WiFi.h>
#include <PubSubClient.h>
#define PIN 25
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
@developersteve
developersteve / gist:17203742744b2c1b5c4059d36c31e281
Created September 2, 2018 22:44
Nginx notifyURL to slack channel for debugging
server
{
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name [domain url in here];
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
proxy_cookie_domain ~(?P<secure_domain>([-0-9a-z]+\.)?[-0-9a-z]+\.[a-z]+)$ "$secure_domain; secure";
ssl_protocols TLSv1.2 TLSv1.1 TLSv1 TLSv1.3;
@developersteve
developersteve / file.php
Created August 17, 2018 01:24
MessagingAPI PHP example
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Telstra_Messaging\Api\AuthenticationApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$client_id = ""; // string |
$client_secret = ""; // string |
$grant_type = "client_credentials"; // string |
@developersteve
developersteve / app.py
Created November 8, 2017 04:18
TelstraDev MessagingAPI - Basic python call create sms
import requests
from var_dump import var_dump
url = "https://tapi.telstra.com/v2/messages/sms"
payload = {'to': '000000000000',
'body': 'Hello World',
'from': '000000000000',
'validity': 1,
'scheduledDelivery': 60,
@developersteve
developersteve / openresty-ubuntu-install.sh
Created January 13, 2017 05:24 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz
tar zxvf openresty-1.9.15.1.tar.gz
cd openresty-1.9.15.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
<?
require 'braintree.php';
Braintree_Configuration::environment('sandbox');
Braintree_Configuration::merchantId('');
Braintree_Configuration::publicKey('');
Braintree_Configuration::privateKey('');
$now = new Datetime();