Skip to content

Instantly share code, notes, and snippets.

@olee12
olee12 / google oauth.go
Created January 7, 2020 03:05
google oauth
package main
import (
"context"
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/gorilla/sessions"
"github.com/prometheus/common/log"
gcloud container clusters list
gcloud container clusters resize $CLUSTER_NAME --num-nodes=0
export KUBECONFIG=/path/to/admin.conf
@olee12
olee12 / race_condition_pointer_of_pointer.go
Created August 10, 2020 11:51
Wrong Try to update config using pointer of pointer
package main
import (
"context"
"fmt"
"math/rand"
"reflect"
"sync"
"time"
"unsafe"
@olee12
olee12 / robert_morris_algo.go
Created December 31, 2020 14:33
Robert Morris algo
package main
// Robert Morris algo
import (
crand "crypto/rand"
"fmt"
"io"
"math/rand"
"time"
)
@olee12
olee12 / curl_post_json.md
Created January 10, 2021 10:34 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@olee12
olee12 / cloudera-docker.md
Created April 13, 2021 07:26 — forked from davideicardi/cloudera-docker.md
Running Cloudera with Docker for development/test
@olee12
olee12 / quick_sort.cpp
Last active October 13, 2021 16:26
quick sort from CLRS
#include <iostream>
#include <vector>
using namespace std;
int partition(vector<int> &vec, int p, int r) ;
void quickSort(vector<int> &vec, int p, int r) {
if(p < r) {
int q = partition(vec, p, r);
quickSort(vec, p, q - 1);