Author:

Javascript game in less then 1kb

Code golf winner of the js1k2010 c=document.getElementById("c");h=t=150;L=w=c.width=800;u=D=50;H=[];R=Math.random;for($ in C=c.getContext('2d'))C[$[J=X=Y=0]+($[6]||'')]=C[$];setInterval("if(D)for(x=

davide
Hadoop-spark-kafka-zookeeper docker compose
spark

Hadoop-spark-kafka-zookeeper docker compose

Docker compose is awesome, especially if you need to spin up your local development environment. the following is the docker-compose I use at home. version: '2.1' services: zoo1: image: zookeeper:3.4.9 restart: unless-stopped hostname: zoo1 ports: - "2181:2181" environment: ZOO_MY_ID:

davide
Not an Hotdog

Not an Hotdog

I love the silicon valley tv series. and lately I've been doing some machine learning and deep learning studies, so what's the most famous image classification problem of the silicon valley series? Obviously Jin Yang's not an hotdog The following is the Keras model

davide
Backslash and pipe on a US keyboard set as UK
keyboard

Backslash and pipe on a US keyboard set as UK

This is for anyone in the UK, stuck with a US layout keyboard!!! Recently I bought a cheap mechanical keyboard from the US, even though the layout US-UK is fairly similar, some keys are in a different position, like the # and some others are missing (¦|). Today I needed to type

davide

Fast line count

The following is a simple bash script used to calculate the number of lines in ginormous text files ( like 20G CSV). #!/bin/bash # get the line count of a file without reading the entire file # accuracy can be adjusted by changing the $linenum parameter path=$1 linenum=$2 head=$(head

davide
DAGs visualization using dagre-3d

DAGs visualization using dagre-3d

Directed Acyclic Graphs are directed graphs, that have a topological ordering, a sequence of the vertices such that every edge is directed from earlier to later in the sequence. DAGs are often used in ETL processes to define pipelines for ingestion/transform of files and lately as a replacement of

davide
Sleep-sort in javascript

Sleep-sort in javascript

Sleep sort is a joke sorting algorithm. Sleep sort spawns off one process for each argument. Each process waits for n milliseconds, then prints out n, meaning it takes 1 millisecond to print out "1", 2 millisecond to print out "2", 100 millisecond to print out

davide
Quick and useful Docker commands and configs
docker

Quick and useful Docker commands and configs

Here is a list of some docker snippets that I use daily. Create a tagged image from Dockerfile docker build -t tag_name /path/to/ Run a docker image in detached mode docker run -p local_port:remote_port -d tag_name Remove stopped containers docker rm $(docker ps -a

davide
Update ssh to version 7.5p1
ssh

Update ssh to version 7.5p1

Follow the instructions to update ssh on the latest version. The process requires patching the current source, which is unfortunately not written anywhere in the open-ssh website. Package Information -Download (HTTP): http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz Download MD5 sum: 652fdc7d8392f112bef11cacf7e69e23 Download size: 1.

davide
ESC
// awaiting input_