Skip to content

Instantly share code, notes, and snippets.

Avatar

Sterling Hanenkamp zostay

View GitHub Profile
@zostay
zostay / README.txt
Last active Aug 3, 2020
Google Authentication Workflow for Pebble Watchapps
View README.txt
None of the workflow examples given in the Google Authentication OAuth2 documentation
(https://developers.google.com/accounts/docs/OAuth2) handle what's needed for Pebble. I
basically had to mix the needs of a client-side application with an offline web application
to get what's needed and work within the restrictions of the Pebble JS toolkit.
The steps are as follows:
1. Setup a Client ID for Web Application on the Google Developer Console
2. On the configuration web pages, with SSL:
* In the configuration page, use JavaScript to retrieve a authorization code, which
@zostay
zostay / bad.psgi
Created Aug 15, 2012
OWASP Top Ten - A2 Cross Site Scripting (XSS) - Good/Bad - In Perl
View bad.psgi
use v5.16;
use Plack::Request;
my $app = sub {
# Use Plack::Request to help parse the environment
my $req = Plack::Request->new(shift);
# Load our input
my $input = $req->parameters->{input};
@zostay
zostay / bad.psgi
Created Aug 1, 2012
OWASP Top Ten - A1 Injection - Good/Bad - In Perl
View bad.psgi
use v5.16;
use Plack::Request;
my $app = sub {
# Plack::Request makes getting parameters easier
my $req = Plack::Request->new(shift);
# Load the name
my $name = $req->parameters->{name};
@zostay
zostay / gist:1358515
Created Nov 11, 2011
Best, quickest, safe way I know to pull out the " at x.pm line 1." is:
View gist:1358515
my $x = reverse $@;
$x =~ s/^.*? \ ta \ //xms;
$x = reverse $x;
@zostay
zostay / gist:1167283
Created Aug 24, 2011
For my own sanity, what order do the around's get applied in an object that applies a role that applies a role?
View gist:1167283
package RoleBar;
use v5.10;
use Moose::Role;
around thing => sub {
my $next = shift;
my $self = shift;
say "RoleBar thing start";
$self->$next();