Skip to content

Instantly share code, notes, and snippets.

View odeke-em's full-sized avatar

Emmanuel T Odeke odeke-em

View GitHub Profile
2017/07/11 01:25:03 http2: Transport failed to get client conn for precious.jp:443: http2: no cached connection was available
2017/07/11 01:25:04 http2: Transport creating client conn 0xc42014c1a0 to 202.238.151.220:443
2017/07/11 01:25:04 http2: Framer 0xc42044d0a0: wrote SETTINGS len=18, settings: ENABLE_PUSH=0, INITIAL_WINDOW_SIZE=4194304, MAX_HEADER_LIST_SIZE=10485760
2017/07/11 01:25:04 http2: Framer 0xc42044d0a0: wrote WINDOW_UPDATE len=4 (conn) incr=1073741824
2017/07/11 01:25:04 http2: Transport encoding header ":authority" = "precious.jp"
2017/07/11 01:25:04 http2: Transport encoding header ":method" = "GET"
2017/07/11 01:25:04 http2: Transport encoding header ":path" = "/"
2017/07/11 01:25:04 http2: Transport encoding header ":scheme" = "https"
2017/07/11 01:25:04 http2: Transport encoding header "accept-encoding" = "gzip"
2017/07/11 01:25:04 http2: Transport encoding header "user-agent" = "Go-http-client/2.0"
@odeke-em
odeke-em / ubercreds.go
Last active July 5, 2017 23:30
Uber OAuth2.0 credentials retrieval
package main
import (
"encoding/json"
"log"
"os"
"path/filepath"
"github.com/orijtech/uber/oauth2"
)
@odeke-em
odeke-em / uberpromo.go
Created July 1, 2017 06:43
Applying a promo code to your Uber account
package main
import (
"fmt"
"log"
"os"
"github.com/orijtech/uber/v1"
)
@odeke-em
odeke-em / rsp-sample.js
Last active July 5, 2017 23:30
Sample usage of rsp for instant/realtime search
<script type="text/javascript" src="https://storage.googleapis.com/realsp/rsp.min.js"></script>
var resp = new Resp({
"itemId": "searchInput",
"apiKey": "fe4123b3-ad36-44f7-9a5b-0ea8c3abc813",
"initialSearch": initialKeyword,
"onMessage": handleNewData,
"onDisconnected": turnOnSpinnerGIF,
"onConnected": turnOffSpinnerGIF,
"onError": function(err) {
@odeke-em
odeke-em / uberhook.go
Created June 10, 2017 07:46
Server to receive, verify and process webhooks from Uber
package main
import (
"flag"
"fmt"
"log"
"net/http"
"golang.org/x/crypto/acme/autocert"
@odeke-em
odeke-em / uber-ride.go
Created June 6, 2017 07:14
Requesting an Uber in Go
package main
import (
"fmt"
"log"
"github.com/orijtech/uber/v1"
)
func main() {
@odeke-em
odeke-em / darksi.de.go
Created June 5, 2017 07:43
HTTPS-ify darksi.de with frontender: generate a binary that could be uploaded directly to cloud storage then pulled and deployed on server
package main
import (
"io"
"log"
"os"
"github.com/orijtech/frontender"
)
@odeke-em
odeke-em / numericBool.go
Created May 19, 2017 20:12
Numeric bool: serialized as int <--> used in code like a boolean
package main
import (
"encoding/json"
"fmt"
"log"
"strconv"
"strings"
)
package main
import (
"fmt"
"log"
"github.com/orijtech/500px/v1"
)
func main() {
@odeke-em
odeke-em / recursiveJSONParse.js
Created March 5, 2017 02:36
Code to recursively parse through JSON that was extra quoted/stringified in multiple nests.
// Function to recursively parse through JSON
// that was extra quoted during stringifying for
// nested levels. This function undoes all that
// work and makes JSON objects for every object
// that it can traverse.
function recursiveJSONParse(obj) {
if (!obj)
return obj;
switch (typeof obj) {