Skip to content

Instantly share code, notes, and snippets.

@esahione
esahione / Dockerfile
Last active December 15, 2018 03:23
Leelazero Dockerfile w GPU
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu18.04
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV DEBIAN_FRONTEND noninteractive
# Install
RUN apt-get -qq update
RUN apt-get install -y cmake g++
@esahione
esahione / numpy-benchmark.py
Created August 16, 2018 00:17 — forked from markus-beuckelmann/numpy-benchmark.py
A short Python script to benchmark NumPy and show your BLAS setup
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Roughly based on: http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration
from __future__ import print_function
import numpy as np
from time import time
import numpy as np
from pandas.tseries.offsets import *
from collections import defaultdict
import statsmodels.api as sm
result_coefficient = defaultdict(lambda: defaultdict(dict))
result_tvalues = defaultdict(lambda: defaultdict(dict))
for x, intraday_data in dataset.items():
intraday_data = intraday_data.set_index('time')
days = intraday_data.resample('B').count().volume
for day in days.index:
@esahione
esahione / dinglebop_sync_async.pyx
Created February 6, 2017 20:57
Dinglebop Sync/Async
cdef db_node_result_t db_node_run_sync(db_req_t *req) nogil:
cdef:
db_node_t *self = req.node
db_tick_t *tick = req.tick
self.enter_behavior(self, tick)
if db_is_node_open_from_req(req):
self.open_behavior(self, tick)
@esahione
esahione / dinglebop_types.pxd
Last active February 6, 2017 20:54
Data Structures - Dinglebop
### Forward declarations
ctypedef struct db_node_t
ctypedef struct db_tick_t
ctypedef struct db_tree_t
### Function definitions for behaviors and ticks
ctypedef void* (*db_node_behavior_cb)(db_node_t *self, db_tick_t *tick) nogil
ctypedef db_node_result_t (*db_node_tick_cb)(db_node_t *self, db_tick_t *tick) nogil
ctypedef struct db_tick_t:
@esahione
esahione / webpack.dev.conf.js
Last active March 18, 2016 22:34
Webpack Development Configuration File
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseConfig.entry).forEach(function (name) {
baseConfig.entry[name] = ['./build/dev-client'].concat(baseConfig.entry[name])
})
@esahione
esahione / webpack.prod.conf.js
Created March 18, 2016 22:33
Webpack Production Configuration
var webpack = require('webpack')
var merge = require('webpack-merge')
var baseConfig = require('./webpack.base.conf')
var cssLoaders = require('./css-loaders')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// whether to generate source map for production files.
// disabling this can speed up the build.
var SOURCE_MAP = true
@esahione
esahione / parallax.vue
Created March 18, 2016 21:54
Parallax Vue
<template lang="jade">
.wrapper
section.parallax-background(:style="parallaxStyle", :id="parallaxId")
.parallax-content(v-if="pcontent != 0")
slot
.scroll-down(v-if="pscrolldown != 0")
</template>
<script>
require('jeet')
@esahione
esahione / arthur.py
Created February 23, 2016 20:06
Simple python app for getting word definitions
import urllib2
import pandas as pd
import json
dataframe = pd.DataFrame({'words': ['test', 'fornication']})
dataframe.index = dataframe['words']
def get_definition(word):
response = urllib2.urlopen('http://dictionaryapi.net/api/definition/' + word)
js = json.loads(response.read())[0]