Skip to content

Instantly share code, notes, and snippets.

View MattKetmo's full-sized avatar

Matt Ketmo MattKetmo

View GitHub Profile
@rikschennink
rikschennink / simulate-pointers.js
Created July 9, 2021 12:20
A script to simulate pointer events, very specific to Pintura project so might need some customisation to work with yours
{
const DEBUG = false;
const style = document.createElement('style');
style.textContent = `
.sim-pointer {
margin-top: -1px;
position: absolute;
z-index: 9999999999999;
left: -24px;
@benjaminion
benjaminion / convert.sh
Last active December 23, 2021 15:15
Convert Eth2 EIP-2335 scrypt keystores to pbkdf2 keystores
## Converts Eth2 EIP-2335 scrypt keystores to pbkdf2 keystores
#
# Requires ethdo (https://github.com/wealdtech/ethdo) and jq.
#
# Tested with ethdo v1.7.3 and Teku v0.12.5+508-g03d75b2
#
# Notes:
# - I'd definitely do this off-line and air-gapped.
# - The files in INPUT_DIR and PASS_DIR are not modified.
# - Take care of directory and file permissions. This script assumes it can
@micimize
micimize / react-native-issues.md
Last active March 24, 2019 20:26
My myriad problems experienced with react-native (I last worked with RN Sep 10th, 2018)

preface

This is a slightly cleaned-up version of the venting I did while pulling my hair out over react-native issues. The state of using react-native might be getting better with the community restructuring and core-rewrite. So take these dated notes with a grain of salt.

summary

After months of struggling to port libraries and develop applications using react-native, I have to recommend trading the comfort and breadth of the react and javascript ecosystems for Flutter and dart if you're developing a mobile app.

react-native is buggy and slow (or at least very hard to make fast). Perhaps it can be blamed on the size of the community, but the project is managed in an almost adversarial style. Almost all issues are ignored until the bot closes them for being "stale". They get locked too, just to make sure the community can't communicate work

@vinyll
vinyll / git-branch-sort.md
Last active July 26, 2021 07:07
Add the `git branch-sort` command to sort all branches by date.
git config --global alias.branch-sort "for-each-ref --sort=-committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'"
@joshuataylor
joshuataylor / app.js
Created October 23, 2017 12:31
Preact component to notify user when a change has been made, and on route change reload the page.
import { h, Component } from 'preact';
import { Router } from 'preact-router';
import Header from './header';
import Home from '../routes/home';
import Profile from '../routes/profile';
import NotifyChange from "./NotifyChange/index";
// import Home from 'async!../routes/home';
// import Profile from 'async!../routes/profile';
@lyrixx
lyrixx / run.php
Last active November 9, 2023 13:51
Updated your templates with the new twig include
<?php
<<<CONFIG
packages:
- "symfony/finder: ~3.0"
- "symfony/console: ~3.0"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
#!/bin/bash
# locate CharName.pm
egrep -i "^[0-9a-f]{4,} .*$*" /usr/lib/x86_64-linux-gnu/perl5/5.24/Unicode/CharName.pm | while read h d; do /usr/bin/printf "\U$(printf "%08x" 0x$h)\tU+%s\t%s\n" $h "$d"; done
@tamalsaha
tamalsaha / ksh
Last active September 21, 2017 05:56
Kubectl exec with working terminal
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: ksh <pod> [flags_to_kubectl]"
exit 1
fi
POD=$1
shift
COLUMNS=`tput cols`
import { connect } from 'react-redux';
import { isFeatureEnabled } from './reducers'
function EnabledFeature({ isEnabled, children }) {
if (isEnabled) {
return children;
}
return null;
}