Skip to content

Instantly share code, notes, and snippets.

View bshaffer's full-sized avatar

Brent Shaffer bshaffer

View GitHub Profile
@bshaffer
bshaffer / prepend.php
Last active September 28, 2017 20:50
<?php
use Google\Cloud\Logging\LoggingClient;
use Google\Cloud\ErrorReporting\Bootstrap;
$prev = set_exception_handler(function ($e) {
if (!class_exists(LoggingClient::class) || !class_exists(Bootstrap::class)) {
// autoload our own libraries
require_once('/sys/cloud_logging_autoloader.php');
}
@bshaffer
bshaffer / iap.php
Last active September 29, 2017 18:32
<?php
/**
* Make an IAP request using "google/auth"
*/
use Google\Auth\CredentialsLoader;
use Google\Auth\Middleware\ScopedAccessTokenMiddleware;
use Google\Auth\OAuth2;
use GuzzleHttp\Client;

William J. Bennett, Host of Bill Bennett’s Morning in America Show, William J. Bennett, is one of America’s most important, influential and respected voices on cultural, political, and education issues. Bill Bennett – what he said:

Interesting take on Trump

They will kill him before they let him be president. It could be a Republican or a Democrat that instigates the shutting up of Trump. Don’t be surprised if Trump has an accident. Some people are getting very nervous: Barack Obama, Valerie Jarrett, Eric Holder, Hillary Clinton and Jon Corzine, to name just a few.

It’s about the unholy dynamics between big government, big business, and big media.They all benefit by the billions of dollars from this partnership, and it’s in all of their interests to protect one another. It’s one for all and all for one.

It’s a heck of a filthy relationship that makes everyone filthy rich, everyone except the American people. We get ripped off. We’re the patsies. But for once, the powerful socialist cabal and the corrupt c

<?php
if (count($argv) < 2) {
exit("usage: publish_release.php [tag]\n");
}
// strip alphabetic characters
$tag = $argv[1];
$version = $tag;
if ('v' == $argv[1][0]) {
@bshaffer
bshaffer / Drive.php
Created December 28, 2015 19:56
Google Drive API (v3) - PHP
<?php
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@bshaffer
bshaffer / TheGoodKind.txt
Last active August 29, 2015 14:07
More Hazards More Heroes - The Good Kind
Capo 3
Verse (Chords): C, D9
Transition (Chords): D9/F, Am7/G
Verse (Tabs):
-------------------------------------------------------------------------------------------
----------------------1--------------------1-------------------1----------------------1----

Keybase proof

I hereby claim:

  • I am bshaffer on github.
  • I am bshaffer (https://keybase.io/bshaffer) on keybase.
  • I have a public key whose fingerprint is 3AD5 86CC 25F9 F2AB BBC1 D900 18D1 CF44 08BB B325

To claim this, I am signing this object:

package com.omniture.android.dashboard.viewer.model.user;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class AuthParams {
String mAuth_username;
String mAuth_nonce;
String mAuth_created;
String mAuth_digest;
package com.omniture.android.dashboard.viewer.model.user;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import com.omniture.android.dashboard.viewer.utilities.Base64Coder;
import com.omniture.android.dashboard.viewer.utilities.ISOUtilities;
import com.omniture.android.dashboard.viewer.utilities.SimpleMD5;
import com.omniture.android.dashboard.viewer.utilities.SimpleSHA1;
protected String getSecurityHeader(String apiKey, String apiSecret, byte[] nonce, String username, String secret, String created) throws UnsupportedEncodingException {
String password64 = AuthenticationHelper.getBase64Digest(nonce, created.getBytes(), secret.getBytes());
StringBuffer header = new StringBuffer();
header.append("UsernameToken Username=\"");
header.append(username);
header.append("\", ");
header.append("PasswordDigest=\"");
header.append(password64.trim());
header.append("\", ");