Skip to content

Instantly share code, notes, and snippets.

@doxxx
doxxx / types.d.ts
Created April 5, 2020 03:09
rfm69radio type module
declare module "rfm69radio-types" {
interface InitializeArgs {
/** 'RF69_315MHZ' or 'RF69_433MHZ' or 'RF69_868MHZ' or 'RF69_915MHZ' depending on radio hardware */
freqBand: string,
/** Address for this node */
address: number,
/** Network ID */
networkID: number,
/** Is High Power radio? Must be true for RF69HCW, RF69HW */
isRFM69HW: boolean,
@doxxx
doxxx / extents.txt
Last active January 3, 2019 15:03
Interval Tree
-1 20
3 5
8 9
@doxxx
doxxx / create-react-app-tslint.md
Last active December 23, 2018 19:51
Steps to add TSLint to create-react-app project using the Typescript compiler plugin
  1. yarn add prettier tslint tslint-config-prettier tslint-react typescript-tslint-plugin
  2. Add the following to tsconfig.json:
    "plugins": [
      {
        "name": "typescript-tslint-plugin"
      }
    ]
  3. Create tslint.json containing the following:
enum BinaryTree<T> {
Leaf(T),
Branch(Box<BinaryTree<T>>, T, Box<BinaryTree<T>>),
}
trait TreeWeight<T>
where
T: std::ops::Add<Output = T> + Copy,
{
fn tree_weight(&self) -> T;
#!/usr/bin/env fish
dmenv manager
docker network create --driver overlay spark
docker service create --name spark-master \
--env SPARK_MASTER_URL=spark://spark-master:7077 \
--network spark \
--constraint "node.role != manager" \
#!/usr/bin/env fish
set NUM_NODES 3
docker-machine create -d virtualbox \
--engine-insecure-registry "manager:5000" \
manager
set MANAGER_IP (dmip manager)

Keybase proof

I hereby claim:

  • I am doxxx on github.
  • I am doxxx (https://keybase.io/doxxx) on keybase.
  • I have a public key ASAwY8RtnvR0IUsLRJQOOQkczbQqNFlgZDvqGSP7e93mBgo

To claim this, I am signing this object:

@doxxx
doxxx / README.md
Last active May 12, 2018 21:44 — forked from hsablonniere/README.md

scrollIntoViewIfNeeded 4 everyone!!!

This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements.

Usage

Just use the code in index.js in your app or website. You can see usage in the test page test.html.

The parent element will only scroll if the element being called is out of the view. The boolean can force the element to be centered in the scrolling area.

@doxxx
doxxx / gist:5459937
Last active December 16, 2015 15:59
trait FreshProducer[T] {
def fresh(): T
}
class Foo {
override def toString = "Foo!"
}
implicit object FooProducer extends FreshProducer[Foo] {
def fresh() = new Foo