Skip to content

Instantly share code, notes, and snippets.

@sinisterra
sinisterra / cbn.py
Created August 8, 2019 21:48
Causality with bayesian networks
from pomegranate import (
DiscreteDistribution,
ConditionalProbabilityTable,
JointProbabilityTable,
BayesianNetwork,
State,
)
season = DiscreteDistribution(
{"spring": 1.0 / 4, "summer": 1.0 / 4, "autumn": 1.0 / 4, "winter": 1.0 / 4}
@sinisterra
sinisterra / code.js
Created January 2, 2019 20:14
Find the first N combinations of n and m where the sum of the digits of n^m equal n
const { range, sum } = require('lodash')
// find the first N combinations of n and m where the sum of the digits of n^m equal n
const run = (count) => {
let results = []
const digits = n => [...String(n)].map(Number)
for (const n of range(2, 300)) {
@sinisterra
sinisterra / clock.js
Created August 19, 2017 19:22
Timers using Redux + RxJS
import { get, omit, includes } from 'lodash'
import { combineEpics } from 'redux-observable'
import { Observable } from 'rxjs'
import update from 'immutability-helper'
const MODULE = 'mun-manager/clock'
const INTERVAL_DURATION = 1000
export const CLOCK_START = `${MODULE}/CLOCK_START`
export const CLOCK_STOP = `${MODULE}/CLOCK_STOP`
@sinisterra
sinisterra / plugins.sbt
Created March 8, 2017 18:13
Scalastyle config
//filename: project/plugins.sbt
// add this line at the end of the file
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")

Keybase proof

I hereby claim:

  • I am sinisterra on github.
  • I am sinisterra (https://keybase.io/sinisterra) on keybase.
  • I have a public key whose fingerprint is AA71 A3E3 511A 1042 2564 86A3 FF60 B9B5 92EE CCEE

To claim this, I am signing this object:

@sinisterra
sinisterra / BlueDawn__custom.tmTheme
Last active July 21, 2016 15:39
BlueDawn__noBrightGreen
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Blue Dawn</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@sinisterra
sinisterra / App.js
Last active May 17, 2016 18:36
React + Redux + Material UI + Styles
import React, { Component } from 'react'
import { Provider } from 'react-redux'
import AppRouter from './AppRouter'
import configureStore from '../store/configureStore'
import initialState from '../store/initialState'
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';