Skip to content

Instantly share code, notes, and snippets.

View lejafar's full-sized avatar

Rafael Hautekiet lejafar

View GitHub Profile
[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Rafael Hautekiet <rafaelhautekiet@gmail.com>"]
[tool.poetry.dependencies]
python = "3.7.4"
bar = {path="submodules/bar", develop=false}
@lejafar
lejafar / openctm.rb
Last active October 24, 2018 09:59
OpenCTM Homebrew recipe
class Openctm < Formula
homepage "http://openctm.sourceforge.net/"
url "https://downloads.sourceforge.net/project/openctm/OpenCTM-1.0.3/OpenCTM-1.0.3-src.zip"
sha256 "1310346651d96dc310022fde23a7d1a7810f32bccdfda4be0ea1b7a3cfd2b583"
depends_on "cmake" => :build
depends_on "llvm" => :build
depends_on "tinyxml" => :optional
depends_on "jpeg"
@lejafar
lejafar / NBPattern.py
Last active January 14, 2018 16:19
Determine the most likely value that is about to follow based on binary sequence using Naive Bayes
#!/usr/bin/env python3
"""
Example implementation of https://stats.stackexchange.com/q/322943/190938
Determine the most likely value that is about to follow based on binary sequence using Naive Bayes
Test should output:
Predicted 1 CORRECTLY for [0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0] , pattern: [0, 1]
Predicted 1 CORRECTLY for [1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0] , pattern: [0, 1]
Predicted 0 CORRECTLY for [1, 1, 0, 1, 0, 0, 1] , pattern: [0, 1, 0]
@lejafar
lejafar / private.xml
Last active June 19, 2016 11:55
private.xml example to trigger a custom script using bluetooth remote using Karabiner, I'm using it with my Qmote from @qblinks
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_whatever</name>
<url type="shell">
<![CDATA[ /bin/bash ~/whatever.sh ]]>
</url>
</vkopenurldef>
<item>
<name>Set remote trigger for ~/whatever.sh</name>