Skip to content

Instantly share code, notes, and snippets.

Avatar

Michal Srb xixixao

  • Facebook
  • London, UK
View GitHub Profile
View gitcreate.sh
#!/bin/bash
# This script create a new repo on github.com, then pushes to it the local repo from the current directory.
# It is a fork of https://gist.github.com/robwierzbowski/5430952/. Some of Rob's lines just didn't work for me, and to fix them I needed to make it more verbose so that a mere electrical engineer could understand it.
# This script gets a username from .gitconfig. If it indicates that your default username is an empty string, you can set it with
# git config --add github.user YOUR_GIT_USERNAME
# Gather constant vars
@xixixao
xixixao / discrete-event-simulation
Created Dec 4, 2013
http://michalsrb.me/teatable/ Run like: > (new Simulation (ExponentialSampler 2), (ConstantSampler 2)).run 100
View discrete-event-simulation
# http://michalsrb.me/teatable/
#
# (new Simulation (ExponentialSampler 2), (ConstantSampler 2)).run 100
class Simulation
constructor: (@interArrival, @serviceTime) ->
@events = []
@t = 0
@population = 0
@scheduleArrival()
@xixixao
xixixao / Switch
Created Apr 3, 2013
Clojure vs Coffee
View Switch
#(defn parting
# "returns a String parting in a given language"
# ([] (parting "World"))
# ([name] (parting name "en"))
# ([name language]
# (condp = language
# "en" (str "Goodbye, " name)
# "es" (str "Adios, " name)
# (throw (IllegalArgumentException.
# (str "unsupported language " language))))))