Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am andreas on github.
  • I am cuvius (https://keybase.io/cuvius) on keybase.
  • I have a public key ASALc5Ofk2xhHQbqvgqL0lYq6jA_TgvlJnOpKH0vrKTaOAo

To claim this, I am signing this object:

diff --git bindings/ffi_bindings.ml bindings/ffi_bindings.ml
index 8a8cc5c..58725d7 100644
--- bindings/ffi_bindings.ml
+++ bindings/ffi_bindings.ml
@@ -44,16 +44,10 @@ module Types (F: Cstubs.Types.TYPE) = struct
let connect_attr_delete = constant "MYSQL_OPT_CONNECT_ATTR_DELETE" int
let server_public_key = constant "MYSQL_SERVER_PUBLIC_KEY" int
let enable_cleartext_plugin = constant "MYSQL_ENABLE_CLEARTEXT_PLUGIN" int
- let can_handle_expired_passwords =
- constant "MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS" int
package main
import (
"fmt"
"github.com/andreas/podio-go"
)
func main() {
authToken, err := podio.AuthWithUserCredentials("my-client-id", "my-client-secret", "my-username", "my-password")
@andreas
andreas / main.go
Created June 9, 2016 10:55
This gist shows the impact of resolving fields in parallel in graphql-go.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/graphql-go/graphql"
)
@andreas
andreas / envelope_encryption.go
Created February 3, 2015 19:25
Envelope Encryption with Amazon KMS and Go
package main
import (
"bytes"
"crypto/rand"
"encoding/gob"
"fmt"
"io/ioutil"
"os"
"time"
# Start with these
[0, [0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0]]
[20, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
# Games with a spare
[29, [5,5, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
[38, [5,5, 1,9, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
# Games with a strike
[30, [1,1, 10, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]]
open Core.Std
open Async.Std
module Ints = struct
type t = int
let to_string = string_of_int
let of_string = int_of_string
end
module IntCache = Memcached.Make(Ints)
{"script":"(a+b)*c*d", "context": {"a": 3, "b": 5, "c": 7, "d": 11}}
@andreas
andreas / gist:5432990
Created April 22, 2013 07:14
Use [rblineprof](https://github.com/tmm1/rblineprof) for profiling Rails apps
class RBLineProfiler
WALL_TIME_LIMIT = 10e3 # ms
def initialize(app)
@app = app
end
def call(env)
result = nil
profile = lineprof(/./) { result = @app.call(env) }
da:
errors:
messages:
not_found: "ikke fundet"
already_confirmed: "er allerede bekræftet"
not_locked: "var ikke låst"
devise:
failure:
unauthenticated: 'Du skal logge ind for at kunne fortsætte.'