Skip to content

Instantly share code, notes, and snippets.

@prasincs
prasincs / stl.md
Last active September 30, 2017 20:12
STL plans

Friday

[X] 9-9:50 -> Keynote on “Measuring and Optimizing Tail Latency”, Theater

[X] 10:10 - 10:50 -> The Biological Path Towards Strong AI, Midland States Bank

[ ] 11:10 - 11:50 -> The hows and whys of a distributed SQL database, Theater

[X] 11:10 - 11:50 -> Running Programs In Reverse for Deeper A.I.

package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"golang.org/x/net/proxy"
package main
import (
"flag"
"fmt"
"log"
"sort"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
import "github.com/nsd20463/numeralsort"
func (c SortImageIds) Len() int { return len(c) }
func (c SortImageIds) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c SortImageIds) Less(i, j int) bool {
//fmt.Println(*c[i].ImageTag, *c[j].ImageTag)
if c[i].ImageTag == nil {
return true
}
@prasincs
prasincs / ecr_list_images.go
Last active May 14, 2017 04:04
ECR list images
package aws
import (
"fmt"
"sort"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecr"
@prasincs
prasincs / gorilla_auth.go
Created March 20, 2017 00:17 — forked from jbuchbinder/gorilla_auth.go
Gorilla mux + basic authentication from htpasswd file
package main
import (
auth "github.com/abbot/go-http-auth"
"github.com/gorilla/mux"
"log"
"net/http"
"time"
)
@prasincs
prasincs / cluster_lines.py
Created March 18, 2017 08:30 — forked from amix/cluster_lines.py
Groups (clusters) similar lines together from a text file using k-means clustering algorithm.
"""
Groups (clusters) similar lines together from a text file
using k-means clustering algorithm.
Also does some simple cleaning (such as removing white space and replacing numbers with (N)).
Example:
python cluster_lines.py --clusters 20 invalid_dates.txt
@prasincs
prasincs / README.md
Last active March 26, 2017 21:12
Sentry Server

You have to run the following

docker compose -f docker-compose-sentry.yml up

I'm running this from a test directory, so docker-compose prefixes everything with test_

docker run -it --rm -e SENTRY_SECRET_KEY=verysecret --link tests_redis_1:redis --link tests_postgres_1:postgres sentry upgrade
@prasincs
prasincs / gh.sh
Created December 29, 2016 08:27
gh
#!/bin/sh
#
# Opens the github page for a repo/branch in your browser.
#
# gh [remote] [branch] [file]
git rev-parse 2>/dev/null
if [[ $? != 0 ]]
then