Skip to content

Instantly share code, notes, and snippets.

View jukben's full-sized avatar
🟣
#E092F1

Jakub Beneš jukben

🟣
#E092F1
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jukben on github.
  • I am jukben (https://keybase.io/jukben) on keybase.
  • I have a public key ASCrxSl-w7_8sf2Iev7n4R4xLnSwDnQFTqofvduxp9dNXAo

To claim this, I am signing this object:

/**
* Copyright (c) 2019-present, ProductBoard, Inc.
* All rights reserved.
*/
export default function transform(file, api) {
const j = api.jscodeshift;
const imports = j(file.source)
.find(j.ImportDeclaration)
@jukben
jukben / CachedLayer.js
Last active December 12, 2022 20:07
Custom Layer for react-leafleat with naive cache mechanism
import { withLeaflet, GridLayer } from "react-leaflet";
import L from "leaflet";
class Grid extends GridLayer {
createLeafletElement() {
const { url, cacheName } = this.props;
const Layer = L.TileLayer.extend({
createTile: (coords, done) => {
const { x, y, z } = coords;
@jukben
jukben / pre-commit.sh
Last active February 25, 2019 12:35
Pre commit Husky + Lint-staged with option to opt out
#!/bin/bash
# http://mywiki.wooledge.org/BashFAQ/105
set -e
if [[ $(git config --get husky.hooks) == "false" ]]; then exit 0; fi
yarn run lint-staged
@jukben
jukben / docker_space_cheat_sheet.md
Created February 15, 2019 12:28 — forked from jalogut/docker_space_cheat_sheet.md
Cheat sheet to check disk usage on docker. Identify what takes most of your space

Total disk size configuration (Mac)

ls -klsh ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw

Total disk usage (Mac)

du -h ~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw
@jukben
jukben / README.md
Created January 27, 2019 09:31
Create bootable USB under macOS

Convert the ISO

hdiutil convert kali-linux-light-2018.4-amd64.iso  -format UDRW -o kali.img

Get the USB disk

diskutil list
@jukben
jukben / git-master-branch-changed-files.sh
Last active January 22, 2019 15:20
git-master-branch-changed-files.sh
#!/bin/bash
# This is complementary script to our lint-staged setup. This is a bit of magic, but please bare with me.
# This script finds new files during the CI job (compared to the master), and
# 1. prints all the files in all commits which are not in the master
# 2. sorts them and unique them
# 3. we care just for src/*.tsx?
# 4. ignore return code of grep :)
@jukben
jukben / command.sh
Last active May 23, 2018 07:30
Sniffing Unix Domain Sockets
socat -t100 -x -v UNIX-LISTEN:/tmp/client,mode=777,reuseaddr,fork UNIX-CONNECT:/tmp/server
@jukben
jukben / terminal.app
Created April 7, 2018 16:55
The disk "Diskname" wasn't ejected because one or more programs may be using it.
# get PID of the process
sudo lsof /Volumes/1TB/
# kill that
kill -9 <PID>
@jukben
jukben / Fastlane
Created March 29, 2018 12:30
Fastlane – example how to increment versions based on package.json
# ios
match(...)
package = load_json(json_path: "../package.json")
increment_version_number(version_number: package["version"])
increment_build_number(build_number: ENV["CIRCLE_BUILD_NUM"] || 1)
# android
package = load_json(json_path: "../package.json")