Skip to content

Instantly share code, notes, and snippets.

View Cinderella-Man's full-sized avatar

Kamil Skowron Cinderella-Man

View GitHub Profile
defmodule Indicator.OhlcWorker do
use GenServer
alias Core.Struct.TradeEvent
alias Decimal, as: D
require Logger
@pubsub_client Application.get_env(:core, :pubsub_client)
@Cinderella-Man
Cinderella-Man / index.html
Created May 27, 2021 19:57
HTML Canvas animations experiment
<html lang="en">
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="./style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
</head>
<body>
<canvas id="canvasDemo" height="1920" width="1080">
Sorry, your browser does not support canvas.
</canvas>
defmodule BinanceMock do
use GenServer
alias Decimal, as: D
require Logger
defmodule State do
defstruct order_books: %{},
subscriptions: [],
@Cinderella-Man
Cinderella-Man / gist:21b8e3cef8e9b743c98515d4e305fb18
Created June 24, 2019 10:51
Playing around with dummy cache server in Node.js
const express = require('express');
const rp = require('request-promise-native');
const app = express();
const port = 3000;
const hostname = 'https://bobs-epic-drone-shack-inc.herokuapp.com';
const cache = {
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop
@Cinderella-Man
Cinderella-Man / installation
Last active May 16, 2019 12:21
i3 env misc
sudo apt install i3 nitrogen
Raspbian installed
- update
- install vino: https://pimylifeup.com/raspberry-pi-screen-sharing/
sudo apt-get install vino
gsettings set org.gnome.Vino authentication-methods "['none']"
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.Vino prompt-enabled false
/usr/lib/vino/vino-server
@Cinderella-Man
Cinderella-Man / Install Elixir on Raspberry Pi (Raspbian)
Last active February 4, 2019 21:15
Step by step - how to setup Elixir 1.8.1 on Raspbian
apt-get install wget libssl-dev ncurses-dev m4 unixodbc-dev erlang-dev
wget http://erlang.org/download/otp_src_21.2.tar.gz
tar -xzvf otp_src_21.2.tar.gz
./configure
# Below takes absolute ages
make
sudo make install
wget https://github.com/elixir-lang/elixir/releases/download/v1.8.1/Precompiled.zip
unzip Precompiled.zip -d elixir
@Cinderella-Man
Cinderella-Man / shell.sh
Last active October 15, 2018 20:58
Kubernetes cheatsheet
```
minikube start --kubernetes-version v1.11.3
sudo apt-get remove kubectl && sudo apt-get install kubectl=1.11.3-00
kubectl version # they should be the same, or clowns will eat you
kubectl get deployments
kubectl get services
kubectl get pods
@Cinderella-Man
Cinderella-Man / promise.all.in.scala
Created April 10, 2017 16:16
Scala's promise.all equivalent
package Main
import services.{PostsService, UsersService}
import dispatch._
import models.{Post, User}
import scala.concurrent.ExecutionContext.Implicits.global
object Main extends App {
def run(): Future[(User, List[Post])] = {