This file contains 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
# General Shortcuts | |
alias wifi="wicd-curses" | |
alias connections="sudo iftop -i wlp4s0" | |
alias restart-network="sudo service network-manager restart" | |
alias work="cd ~/Workspace" | |
alias dc="docker-compose" | |
# Mistake Shortcuts | |
alias gti="git" |
This file contains 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
# General Shortcuts | |
alias wifi="wicd-curses" | |
alias connections="sudo iftop -i wlp4s0" | |
alias restart-network="sudo service network-manager restart" | |
alias work="cd ~/Workspace" | |
alias dc="docker-compose" | |
# Mistake Shortcuts | |
alias gti="git" |
This file contains 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
class Store { | |
constructor(reducer) { | |
const [state, dispatch] = reducer; | |
this.state = Object.freeze(state); | |
this._dispatch = dispatch; | |
this._effectFunc = null; | |
} | |
dispatch(action) { | |
const prevState = Object.freeze({ ...this.state }); |
This file contains 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
const useDidUpdate = () => { | |
const isNotMounted = useRef(true); | |
useEffect(() => { | |
if (isNotMounted.current) { | |
isNotMounted.current = false; | |
} | |
}); | |
return !isNotMounted.current; | |
}; |
This file contains 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
byte incomingBytes[32]; | |
byte powerOn[] = {0x6, 0x01, 0x00, 0x19, 0x02, 0x1C}; | |
byte powerOff[] = {0x6, 0x01, 0x00, 0x19, 0x01, 0x1F}; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
digitalWrite(LED_BUILTIN, LOW); | |
} |
This file contains 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
# A simple DSL for createing dependency injected modules/classes. | |
module Opaque::Injector | |
# Full DSL setup, this creates a module for dependencies dynamically. | |
# | |
# ``` | |
# include Injector | |
# | |
# dependencies do | |
# dependency :logger, Logger.new(STDOUT, Logger::INFO) | |
# end |
This file contains 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
# The /dev/null forces grep to have multiple file names so it tricks the output into listing the files their names | |
grep ${REPLACE-ME} /dev/null * |
This file contains 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debug", | |
"type": "pwa-node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], | |
"args": ["src/{{YOUR_ENTRYPOINT}}.ts"], |
This file contains 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "pwa-node", // This is important otherwise the paths and arguments all don't work | |
"request": "launch", | |
"name": "Debug {{YOUR_SERVICE}}", | |
"program": "${workspaceFolder}/node_modules/backpack-core/bin/backpack", | |
"args": ["dev", "|", "pino-pretty", "-c"], // Last two argument are optional, I use pino at work for logging | |
// Also pipe our logs into pino-pretty -c for nicer outputs |
This file contains 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
// ------------------------------------------------------------------------------------------------------------------- | |
import BigNumber from 'bignumber.js'; | |
import { logger, Postgres } from 'node-common'; | |
import { BlockRaw } from '../../types'; | |
import { isContinousSequence, normalizeBlockchainId, normalizeTimestamp } from '../../helpers'; | |
import groupBy from 'lodash/groupBy'; | |
import uniqBy from 'lodash/uniqBy'; | |
import { createKafkaOptions } from '../baseConsumer'; |