Skip to content

Instantly share code, notes, and snippets.

@arosh
arosh / advent1.ipynb
Last active December 12, 2016 07:09
Jupyter Notebook Advent Calendar 2016, Dec, 13th (1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arosh
arosh / advent2.ipynb
Created December 12, 2016 07:10
Jupyter Notebook Advent Calendar 2016, Dec, 13th (2)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arosh
arosh / main.go
Last active December 17, 2016 17:13
goroutine cancel
package main
import (
"fmt"
"time"
)
func main() {
cancel := make(chan struct{})
go func() {
@arosh
arosh / main.go
Created December 18, 2016 07:14
image server
package main
import (
"net/http"
"log"
"runtime/debug"
"io/ioutil"
"strconv"
)
@arosh
arosh / main.go
Created December 30, 2016 16:58
read until EOF
package main
import (
"bufio"
"fmt"
"os"
"io"
"log"
)
@arosh
arosh / queue_test.go
Created January 25, 2017 18:08
type assertion is too slow
package main
import (
"testing"
"errors"
)
var (
ErrQueueEmpty = errors.New("Queue is empty")
)
@arosh
arosh / hello.js
Last active March 14, 2017 02:37
Promise sleep
function wait () {
return new Promise((resolve, reject) => {
setTimeout(resolve, 1000)
})
}
function foo (i) {
return new Promise((resolve, reject) => {
console.log(i)
resolve()
def stanfit_to_dataframe(fit, pars=None):
"""
Parameters
==========
fit : pystan.StanFit4model
"""
import pandas
summary = fit.summary(pars=pars)
columns = summary['summary_colnames']
index = summary['summary_rownames']
@arosh
arosh / simple.ipynb
Created April 17, 2017 12:17
stan-aoj (1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.