This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Use: | |
-- select f_py_uuid5('30fb0513-dddf-4801-ac98-dacc8b7953e5', '[email protected]'); | |
-- > d6d2210e-b94c-5a26-95b7-ccf97f29ad1f | |
create or replace function f_py_uuid5(namespace varchar, name varchar) | |
returns varchar | |
immutable | |
as $$ | |
import uuid | |
return uuid.uuid5(uuid.UUID(namespace), name).__str__() | |
$$ language plpythonu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg, err := external.LoadDefaultAWSConfig() | |
if err != nil { | |
panic(err) | |
} | |
esCfg := elasticsearch.Config{ | |
Transport: &awssigner.V4Signer{ | |
RoundTripper: http.DefaultTransport, | |
Credentials: cfg.Credentials, | |
Region: cfg.Region, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import io | |
import os | |
import tarfile | |
import docker | |
parser = argparse.ArgumentParser() | |
parser.add_argument('app', help='GO app name (located in $GOPATH/bin/)') | |
parser.add_argument('tag', help='Docker image tag') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
) | |
type Business struct { | |
ID string `json:"id"` | |
Name string `json:"name"` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from optparse import OptionParser | |
import sys | |
import redis | |
__author__ = 'Jimmy John' | |
__doc__ = ''' | |
This is a script to make a copy of a redis db. Mainly to be used for cloning AWS Elasticache | |
instancces. Elasticache seems to disable the SAVE/BGSAVE commands and you do not have access to | |
the physical redis instances. The UI allows you to create 'Snapshots', but no way to download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"strconv" | |
"sync" | |
"time" | |
"github.com/aws/aws-sdk-go/aws" |