Skip to content

Instantly share code, notes, and snippets.

@Mistobaan
Mistobaan / logapi.go
Created Feb 10, 2014
Logging Handler
View logapi.go
package programs
import (
"encoding/base64"
"html/template"
"net/http"
"time"
"appengine"
"appengine/log"
View gist:8955389
[info] Loading project definition from /home/fmilo/example-scala-build/project
[info] Set current project to amx-livescore (in build file:/home/fmilo/example-scala-build/)
[info] Updating {file:/home/fmilo/example-scala-build/}default-eb146d...
[info] Resolving org.eclipse.jetty#jetty-server;7.6.8.v20121106 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-server/7.6.8.v20121106/jetty-server-7.6.8.v20121106.pom
[info] Resolving org.eclipse.jetty#jetty-project;7.6.8.v20121106 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-project/7.6.8.v20121106/jetty-project-7.6.8.v20121106.pom
[info] Resolving org.eclipse.jetty#jetty-parent;20 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-parent/20/jetty-parent-20.pom
[error] Server access Error: Con
View gist:8970643
import au.com.bytecode.opencsv.CSVReader
import java.io.FileReader
import scala.collection.JavaConversions._
import java.util.UUID
import java.text.SimpleDateFormat
val format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss")
case class Stock(data: Array[String]) {
View gist:8963771
info] Loading project definition from /home/fmilo/example-scala-build/project
[info] Set current project to amx-livescore (in build file:/home/fmilo/example-scala-build/)
[info] Updating {file:/home/fmilo/example-scala-build/}default-eb146d...
[info] Resolving org.eclipse.jetty#jetty-server;7.6.8.v20121106 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-server/7.6.8.v20121106/jetty-server-7.6.8.v20121106.pom
[info] Resolving org.eclipse.jetty#jetty-project;7.6.8.v20121106 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-project/7.6.8.v20121106/jetty-project-7.6.8.v20121106.pom
[info] Resolving org.eclipse.jetty#jetty-parent;20 ...
[error] Server access Error: Connection timed out url=https://repository.cloudera.com/artifactory/cloudera-repos/org/eclipse/jetty/jetty-parent/20/jetty-parent-20.pom
[error] Server access Error: Conn
View osx-for-hackers.sh
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@Mistobaan
Mistobaan / limit.go
Last active Aug 29, 2015
RequestLimiter
View limit.go
package main
import (
"fmt"
"math/rand"
"runtime"
"sync"
"time"
)
View drone_setup.sh
#!/bin/bash
set -e
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) || :
source /home/ubuntu/.gvm/scripts/gvm
gvm install go1.2.2 --with-build-tools --binary
gvm use go1.2.2
@Mistobaan
Mistobaan / ec2_dns_check.go
Created Nov 1, 2014
Check if there is an interface with a given name
View ec2_dns_check.go
package main
import (
"log"
"net"
"strings"
)
func trace(fmt string, args ...interface{}) {
log.Printf(fmt, args...)
@Mistobaan
Mistobaan / bench.rb
Created Nov 6, 2014
ruby include benchmark string vs symbols
View bench.rb
require 'benchmark'
require 'set'
# an attempted to remove the .freeze everywhere
class String
alias :f :freeze
end
n = 20000000