Skip to content

Instantly share code, notes, and snippets.

View ArionHardison's full-sized avatar
🏠
Working from home

HIM ArionHardison

🏠
Working from home
  • Hardison Co.
  • Los Angeles, CA
  • 12:18 (UTC -12:00)
View GitHub Profile
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', github: 'rails/rails', :branch => '4-0-stable'
gem 'pg'
gem 'thin'
gem 'draper' # decorator
gem 'friendly_id'
gem 'omniauth'
gem 'omniauth-facebook', '1.4.0'
<?php
$url ="https://labourclp188.nationbuilder.com/api/v1/sites/labourclp188/pages/basic_pages?access_token=1dbc3ed982c56e725e5d1fc4739be05f3c5b26ad5d3ac407b5cb54bcda4849c9";
$data = array(
'basic_page' => array(
'slug' => "my-page",
'status' => "published",
'name' => "my-page",
'headline' => "my-page",
<?php
//put in your nation slug and token
$url ="https://<your slug>.nationbuilder.com/api/v1/people?access_token=<token>";
$data = array(
'person' => array(
'email' => "[email protected]",
'last_name' => "Bob",
'first_name' => "Smith",
<?php
require('Client.php');
require('IGrantType.php');
require('AuthorizationCode.php');
const CLIENT_ID = 'e8fefc347be6be281bf217d254cbdd5c4ec21f9ea889bfeee3d87bd95222ad9f';
const CLIENT_SECRET = '958abd92ca65034f6966c22a579abf93cba220b36831a04fc73e98ed11d0093a';
const REDIRECT_URI = "http://example.com/";
const AUTHORIZATION_ENDPOINT = "https://arion.nationbuilder.com/oauth/authorize";
public static void CreateSignup(string fName, string lName, string state, string phone, string zip, string userId, string email)
{
try
{
string NB_ID = string.Empty;
using (WebClient NB_API_Client = new WebClient())
{
NB_API_Client.Headers["Content-type"] = "application/json";
NB_API_Client.Headers["Accept"] = "application/json";
NB_API_Base = 'arion.nationbuilder.com'
<?php
$url ="https://arion.nationbuilder.com/api/v1/imports?access_token=d80bd609b7634d77fb6f38a444cfb093da6c596c98b49fc0099ff8864e30d8b8";
$data = array(
"import" => array(
"file" => "aWQsZmlyc3RfbmFtZSxsYXN0X25hbWUNCjEsQnlyb24sQW5kZXJzb24",
"type" => "people",
"is_overwritable" => true
)
// http://en.wikipedia.org/wiki/Merge_sort
let rec mergeSort (arr : 'a []) =
let split (arr : _ array) =
let n = arr.Length
arr.[0..n/2-1], arr.[n/2..n-1]
let rec merge (l : 'a array) (r : 'a array) =
let n = l.Length + r.Length
let res = Array.zeroCreate<'a> n
let mutable i, j = 0, 0
<?php
require('PHP-OAuth2/src/OAuth2/Client.php');
require('PHP-OAuth2/src/OAuth2/GrantType/IGrantType.php');
require('PHP-OAuth2/src/OAuth2/GrantType/AuthorizationCode.php');
$clientId = '9b8b0e1fe97d8efb3cb634ea65c03c8de269121894b980b1935db889aac11634';
$clientSecret = 'afc5c60f67b00443d858efb9226b71da3a64873764ae4acf7d4a8cfc43cff91c';
$client = new OAuth2\Client($clientId, $clientSecret);
# the graphs in this case are represented by their adjacency matrix (see below),
# where graph[i][j] == 1 if there is an edge between nodes
#todo - try and implement as breadth first or at least figure out which would be bettter
lbl = %w(Good OK Better Meh Worse Not_OK Bad)
graph = [0,1,1,0,0,1,0,0,0,1], # Good
[1,0,0,0,0,0,0,1,1,0],
[0,0,0,0,0,0,0,0,0,0],
User Load (1.5ms) SELECT "users".* FROM "users" WHERE "users"."uid" = $1 LIMIT 1 [["uid", "[email protected]"]]
DEBUG [86302d37] D, [2015-09-09T16:49:32.121083 #11040] DEBUG -- : Dog Load (0.6ms) SELECT "dogs".* FROM "dogs" WHERE "dogs"."user_id" = $1 AND "dogs"."id" = $2 LIMIT 1 [["user_id", 119], ["id", 80]]
DEBUG [86302d37] D, [2015-09-09T16:49:32.123300 #11040] DEBUG -- : (0.4ms) BEGIN
DEBUG [86302d37] D, [2015-09-09T16:49:32.124568 #11040] DEBUG -- : Park Load (0.6ms) SELECT "parks".* FROM "parks" WHERE "parks"."id" = $1 LIMIT 1 [["id", 46]]
DEBUG [86302d37] D, [2015-09-09T16:49:32.126335 #11040] DEBUG -- : SQL (0.6ms) INSERT INTO "bark_dates" ("starts_at", "park_id", "dog_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["starts_at", "2015-09-09 05:03:35.839912"], ["park_id", 46], ["dog_id", 80], ["created_at", "2015-09-09 16:49:32.125112"], ["updated_at", "2015-09-09 16:49:32.125112"]]
DEBUG [86302d37] D, [2015-09-09T16:49