Skip to content

Instantly share code, notes, and snippets.

View GilbertoBotaro's full-sized avatar

Gilberto Botaro GilbertoBotaro

  • UNCOVER SYSTEMS
  • Brazil
View GitHub Profile
@GilbertoBotaro
GilbertoBotaro / hapiExample.js
Created June 7, 2018 01:38 — forked from nvcexploder/hapiExample.js
basic hapi.js example highlighting HTTP methods and a few request parameters
/*
For this to run, ensure that `npm install hapi` has happened in your directory
setup whilst writing this:
iojs v. 1.0.5
hapi 8.2.0
*/
var Hapi = require('hapi');
@GilbertoBotaro
GilbertoBotaro / csv-to-json.php
Created January 18, 2017 22:10 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
import {Sql} from "../providers/Sql";
export class ExamplePage {
constructor(private sql: Sql) {
//sql.query(...);
//...
}
}
@GilbertoBotaro
GilbertoBotaro / tor_curl.php
Created September 13, 2016 15:16 — forked from zachflower/tor_curl.php
How To Anonymize PHP cURL Requests Using Tor
<?php
$ip = '127.0.0.1';
$port = '9051';
$auth = 'PASSWORD';
$command = 'signal NEWNYM';
$fp = fsockopen($ip,$port,$error_number,$err_string,10);
if(!$fp) { echo "ERROR: $error_number : $err_string";
return false;
@GilbertoBotaro
GilbertoBotaro / application-session-management-with-oauth.md
Created April 12, 2016 13:07 — forked from ryanpager/application-session-management-with-oauth.md
Application Session Management With OAuth -- Ionic & AngularJS

Application Session Management With OAuth

Fun with AngularJS & Ionic

I don't know about other developers -- but one of the most frustrating things in my mind to get going when starting a new hybrid application is session/authorization management. Do you use OAuth 1, OAuth 2, generic email login, facebook...even thinking about it stresses me out. Unfortunately, no good hybrid (or mobile for that matter) application can escape the need for good authorization (unless it is a stateless app, like a calculator, or something easy).

Personally -- I have come to love the OAuth 2 standard for its simplicity, and standards of operation. It takes some of the stress out of the decision making process when coming up with how to manage application state flow -- something which is especially necessary in [most] mobile (or native) applications. This article is going to focus on one of those pain points -- hybrid mobile app state management, and how to solve it with regards to the marriage of AngularJS & Ion