Skip to content

Instantly share code, notes, and snippets.

View christopherhesse's full-sized avatar

Christopher Hesse christopherhesse

View GitHub Profile
key = "1sW28zp7CWv5TtGjlQpDHHG4Cbr9v36fG5o4f74LsKg=".decode("base64")
tag = "OBA7UU/Rd9j0Zn+9korAyQ==".decode("base64")
initialization_vector = "O2QAL8AYQB+qbre8".decode("base64")
encrypted_message = "7YS1aTE=".decode("base64")
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
decryptor = Cipher(
algorithms.AES(key),
@christopherhesse
christopherhesse / gist:fee14d722b60121725dc
Last active August 29, 2015 14:25
appengine image API with GCS
import (
"appengine/blobstore"
aeimage "appengine/image"
)
func servingURL(c appengine.Context) error {
blobKey, err := blobstore.BlobKeyForFile(c, "/gs/bucketname/file")
if err != nil {
return err
}
diff --git a/memcache.go b/memcache.go.txt
index ece54b4..d8eed4b 100644
--- a/memcache.go
+++ b/memcache.go.txt
@@ -26,7 +26,7 @@
// if err := memcache.Set(c, item1); err != nil {
// return err
// }
-package memcache
+package memcache // import "google.golang.org/appengine/memcache"
diff --git a/memcache_service.pb.go b/memcache_service.pb.go2.txt
index 0b412f9..d0d1f5f 100644
--- a/memcache_service.pb.go
+++ b/memcache_service.pb.go2.txt
@@ -1,11 +1,12 @@
// Code generated by protoc-gen-go.
+// source: google.golang.org/appengine/internal/memcache/memcache_service.proto
// DO NOT EDIT!
/*
import (
"code.google.com/p/goauth2/appengine/serviceaccount"
"golang.org/x/net/context"
"appengine"
)
// oauth2 module requires a context.Context so use goauth2 for now
func CloudContext(c appengine.Context, scopes ...string) context.Context {
client, _ := serviceaccount.NewClient(c, scopes...)
return cloud.WithContext(context.Background(), appengine.AppID(c), client)
import (
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/appengine"
)
func CloudContext(c context.Context, scopes ...string) context.Context {
client := &http.Client{
Transport: &oauth2.Transport{

Keybase proof

I hereby claim:

  • I am christopherhesse on github.
  • I am csh (https://keybase.io/csh) on keybase.
  • I have a public key whose fingerprint is 5F7E 85CB CE3A 4E57 A25F 46C6 CB16 D055 1626 87F0

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<body>
<style>
html, body, div {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
* `src config`
Running: [/Users/christopherhesse/.srclib/sourcegraph.com/sourcegraph/srclib-go/.bin/srclib-go scan --repo --subdir .]
--> with input {}
Running: [/Users/christopherhesse/.srclib/sourcegraph.com/sourcegraph/srclib-python/.bin/srclib-python scan --repo --subdir .]
--> with input {}
failed due to error: could not get requirements due to error setup.py does not exist
SCANNERS (2)
- sourcegraph.com/sourcegraph/srclib-go scan
- sourcegraph.com/sourcegraph/srclib-python scan
* went to https://github.com/sourcegraph/sourcegraph-atom
* went to https://srclib.org/gettingstarted/#install-srclib
* downloaded mac os x version
* unzipped and put into /usr/local/bin
* ran `src toolchain install-std` (I didn't notice this was necessary the last time I installed srclib, seems like maybe the standard toolchain should come pre-built and installed?)
Installing/upgrading standard toolchains...
Go (sourcegraph.com/sourcegraph/srclib-go) ====================================
skipped sourcegraph.com/sourcegraph/srclib-go: no GOPATH set (assuming Go is not installed and you don't want the Go toolchain)