Skip to content

Instantly share code, notes, and snippets.

View matthewfitz's full-sized avatar

Matt Fitzgerald matthewfitz

View GitHub Profile
@matthewfitz
matthewfitz / keycloak.sh
Last active November 13, 2017 17:58 — forked from paoloantinori/keycloak.sh
Keycloak Admin API Rest Example
brew install jq
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("YOUR-API-KEY");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
@matthewfitz
matthewfitz / csv_splitter.py
Created November 29, 2011 19:07 — forked from palewire/csv_splitter.py
A Python CSV splitter
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments:
<?php
$ch = curl_init("https://opensky.com/api/v1/json/users");
$encoded = urlencode('email').'='.urlencode('matthewfitz@gmail.com');
$encoded .= urlencode('firstName').'='.urlencode('Matt');
$encoded .= urlencode('lastName').'='.urlencode('Fitz');
$encoded .= urlencode('password').'='.urlencode('xxxxxx');
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
<?php
$ch = curl_init("https://opensky.com/api/v1/json/users/exist?email=matthewfitz@gmail.com");
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X_OPENSKY_API_KEY: foobar'));
$head = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
<?php
$ch = curl_init("https://opensky.com/api/v1/json/heartbeat");
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X_OPENSKY_API_KEY: foobar'));
$head = curl_exec($ch);
POST https://opensky.com/api/v1/json/users
email=test_test.com
Status: 422
{
"code": 422,
"message": "Please provide valid email address"
}
POST https://opensky.com/api/v1/json/users
email=test@est.com
Status: 417
{
"code": 417,
"message": "There is an existing account associated with this email."
}
Status: 202
{
"code": 202,
"message": "Accepted",
"redirect": "http://google.com"
}
GET https://opensky.com/api/v1/json/users/exist?email=test_test.com
Status: 422
{
"code": 422,
"message": "Please provide valid email address"
}