yarn add prettier tslint tslint-config-prettier tslint-react typescript-tslint-plugin
- Add the following to
tsconfig.json
:"plugins": [ { "name": "typescript-tslint-plugin" } ]
- Create
tslint.json
containing the following:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Windows.Input; | |
using CommunityToolkit.Mvvm.Input; | |
public static class RelayCommandHelpers | |
{ | |
private static readonly List<WeakReference<IRelayCommand>> _commands = new(); | |
public static void RegisterCommandsWithCommandManager(object container) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-1 20 | |
3 5 | |
8 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set NUM_NODES 3 | |
docker-machine create -d virtualbox \ | |
--engine-insecure-registry "manager:5000" \ | |
manager | |
set MANAGER_IP (dmip manager) |
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:
This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded
that can be called on DOM elements.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait FreshProducer[T] { | |
def fresh(): T | |
} | |
class Foo { | |
override def toString = "Foo!" | |
} | |
implicit object FooProducer extends FreshProducer[Foo] { | |
def fresh() = new Foo |