Skip to content

Instantly share code, notes, and snippets.

Justin Thomas base698

  • VDMS
  • Santa Monica, CA
Block or report user

Report or block base698

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stock.sol
pragma solidity ^0.4.10;
contract Stock {
mapping (address => shares) stockHolders;
uint numShares;
function Stock() {
numShares = 100;
}
@base698
base698 / chord.html
Last active Feb 17, 2017
Sample chord diagram. Look at L235 to change the data.
View chord.html
<html>
<script>
// CSV file for link visits
// if there are 3 links here , then the data for the matrix is 3x3 for the links.
var uris = "link,visits,color\n" +
"/discover,1000,#E41A1C\n" +
"/tv,800,#FFFF33\n" +
"/channels,150,#FF7F00\n";
// Visitors from one page to another, eg this says 4 visitors went /discover -> /tv
@base698
base698 / screenshot.sh
Last active Feb 11, 2017
Easy copy and paste markdown.
View screenshot.sh
#!/bin/bash
bucket=rbmhmisc
uploaded_name=jt-$(date +"%Y-%m-%d-%s")-sn.png
s3_path=s3://$bucket/$uploaded_name
file=$(ls -tr ~/Desktop/Screen* | tail -n 1)
aws s3 cp "$file" "$s3_path" --acl public-read
@base698
base698 / api_todo.org
Created Dec 20, 2016
Task List in Progress
View api_todo.org

Defining a Process [%]

Collective Standards

https://wiki.redbullmediahouse.com/pages/viewpage.action?title=%5BDraft%5D+Collective+Standards+for+public+APIs&spaceKey=RBTVDP&focusedCommentId=15599868

Pricing Spreadsheet [50%]

https://docs.google.com/spreadsheets/d/1tRwEPii2smc6riw1enIXd2E0vH_Q199FTg91e2RSNUY/edit#gid=918270629

do yearly cost with DB/API included
make one single dropdown for time selection

How much can we spend? How Performant does each node need to be?

Sheet for determining resources of a service. How many CPU? How much RAM?

Circuit Breakers [0%]

View perf
# hello world
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100000 requests
Completed 200000 requests
Completed 300000 requests
Completed 400000 requests
@base698
base698 / HTTP.java
Last active Nov 9, 2016
Stack Trace
View HTTP.java
import java.net.URL;
import java.net.URLConnection;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.StringBuffer;
public class HTTP {
public static void get() throws Exception {
String urlString = "http://localhost:1234/";
@base698
base698 / handler.clj
Created Oct 26, 2016
You can create a template app with lein with: lein new compojure hello-world
View handler.clj
(ns in-mem.handler
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(def start (slurp "../../tests/start.json"))
(defroutes app-routes
(GET "/start" [] start)
(route/not-found "Not Found"))
View couchbase-bench.go
package main
import (
"github.com/couchbase/go-couchbase"
"flag"
"log"
"math/rand"
"fmt"
"time"
"strconv"
@base698
base698 / nginx.conf
Created Aug 24, 2016
nginx Built with: ./configure --add-module=../memc-nginx-module/ --add-module=../ngx_devel_kit/ --add-module=../set-misc-nginx-module/ --add-module=../redis2-nginx-module/ --add-module=../srcache-nginx-module/ --add-module=../echo-nginx-module/ --add-module=../ngx_http_redis-0.3.8
View nginx.conf
#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@base698
base698 / load-users.sh
Created Aug 22, 2016
Create a bunch of random users for a PG Database
View load-users.sh
#!/bin/bash
psql < create.sql
shuffled=./shuffled-words.txt
cat /usr/share/dict/words | awk 'BEGIN{srand()}{printf "%06d %s\n", rand()*1000000, $0;}' | sort -n | cut -c8- | head -n 20000 > $shuffled
>inserts.sql
exec 5< $shuffled
You can’t perform that action at this time.