Skip to content

Instantly share code, notes, and snippets.

View pokorson's full-sized avatar

Mateusz Pokora pokorson

  • Motimate
  • Lodz
View GitHub Profile
@romgrk
romgrk / patch-redux-toolkit.ts
Last active October 28, 2024 19:06
redux-toolkit reducers without immer
import { AnyAction, Slice } from '@reduxjs/toolkit'
/* The redux-toolkit maintainers refuse to add a way to disable immer.js for
* specific reducers, therefore we need to create an escape hatch by ourselves.
* Immer.js needs to be disabled in certain cases for performance reasons.
* Link: https://github.com/reduxjs/redux-toolkit/issues/242
*/
/** Add reducers without immer.js to a redux-toolkit slice */
export function addRawReducers<S>(
@hothero
hothero / aes_cbc_pkcs5.go
Last active August 22, 2024 07:16
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)
@maxim
maxim / gh-dl-release
Last active November 11, 2024 09:33
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@sebmarkbage
sebmarkbage / Enhance.js
Last active November 7, 2024 13:05
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {