Skip to content

Instantly share code, notes, and snippets.

package overpoker.web
import org.http4s.server._
import org.http4s.dsl._
trait HelloService{
def sayHello(name: String): String
}
object RealHelloService extends HelloService{
@quii
quii / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
(def counter (atom 0))
(defn click-counter [] [:input {:type "button" :value "clicky" :on-click #(swap! counter inc)}])
(defn home-page []
[:div [:h1 "Counter " @counter] [click-counter]])
@quii
quii / clojure.clj
Last active August 29, 2015 14:26
My notes on learning some clojure
(comment
Clojure notes. Gathered from links below and "Programming Clojure"
- Uniform syntax.
- Code is data
- Immutablility encouraged
- [http://learnxinyminutes.com/docs/clojure/]
- [http://www.4clojure.com/problem/8#prob-title]
- [http://www.braveclojure.com/]
- Revenge of the nerds http://www.paulgraham.com/icad.html
@quii
quii / composition.clj
Created July 24, 2015 13:14
Function composition in Clojure
foo=> (defn x [a] (+ a 1))
#'foo/x
foo=> (defn y [a] (+ a 2))
#'foo/y
foo=> (-> 5 x y)
8
foo=> (defn z [a] (-> a x y))
#'foo/z
foo=> (z 10)
13
package main
import (
"fmt"
"net/http"
)
type CoPublisher struct {
id string
link string
@quii
quii / channel.go
Created April 7, 2015 16:20
Simple golang channel example
package main
import (
"fmt"
)
type Baz struct {
Y string
}
const wordSeparator = ", "
const errorMsg = "ALL OTHER SOFTWARE TEAMS ARE USELESS, OUTSOURCING IS A SHAM"
type apiResult struct {
content string
err error
}
// Stitcher calls the Hello and World APIs to create a very useful string
func Stitcher(helloURL string, worldURL string) string {
func Test_it_handles_non_ok_from_hello_api(t *testing.T) {
helloAPI := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.Error(w, "oops", http.StatusInternalServerError)
}))
worldAPI := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "world")
}))
const wordSeparator = ", "
// Stitcher calls the Hello and World APIs to create a very useful string
func Stitcher(helloURL string, worldURL string) string {
helloChannel := make(chan []byte, 1)
worldChannel := make(chan []byte, 1)
go getStringFromAPI(helloChannel, helloURL)
go getStringFromAPI(worldChannel, worldURL)