Skip to content

Instantly share code, notes, and snippets.

View Cretezy's full-sized avatar

Cretezy

View GitHub Profile
@Cretezy
Cretezy / Tmux cheatsheet.md
Last active July 26, 2016 17:56
All you need to know for tmux

Charles' simple tmux guide

tmux is a better and more modern screen alternative. When refering to PREFIX, it usually is CTRL + B. This can be edited in the tmux config.

Basic Commands

Create session tmux new -s <name>

Attact to session tmux a -t <name>

Keybase proof

I hereby claim:

  • I am cretezy on github.
  • I am cretezy (https://keybase.io/cretezy) on keybase.
  • I have a public key ASAyf6-mYb28_SnKYGRlnTBdDFIMpI4hgGlFXV21WC93Rgo

To claim this, I am signing this object:

Better react-hotkeys HOC

Usage:

withHotKeys({ new: "alt+n" }, { new: props => event => console.log(props, event) })(...)

Useful to use with recompose.

@Cretezy
Cretezy / Tools.md
Created May 30, 2018 15:24
Tools I use
@Cretezy
Cretezy / FirestoreBatcher.js
Last active June 3, 2018 05:36
Helper for batching operations in Firestore
export class FirestoreBatcher {
batches = [];
index = 0;
constructor(firestore) {
this.firestore = firestore;
}
getNext() {
if (this.index++ % 500 === 0) {
@Cretezy
Cretezy / keybase.md
Created July 27, 2018 04:49
Keybase

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@Cretezy
Cretezy / signing.js
Last active February 21, 2019 06:14
Node signing helper
import crypto from "crypto";
const separator = ":";
export function sign(content, secret) {
const signature = generateSignature(content, secret);
return {
signature,
content,
signedContent: join(content, signature)
@Cretezy
Cretezy / .dockerignore
Last active October 18, 2019 21:44
Node + Docker with proper caching
Dockerfile
node_modules
import 'package:flutter_super_state/flutter_super_state.dart';
final store = Store();
// Register modules. Order does not matter. You should register all modules on initialization
CounterModule(store);
class LoginScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Login"),
),
body: Center(
// Login button