Skip to content

Instantly share code, notes, and snippets.

View jukben's full-sized avatar
🟣

Jakub Beneš jukben

🟣
View GitHub Profile
@jukben
jukben / styledElement.js
Last active June 5, 2017 14:10
StyledElement 🎨 – new minimalistic & powerful CSS in JS solution 😂
/*
styledElement - new minimalistic & powerful CSS in JS solution
Example of usage:
const div = styledElement("div", {background: red})
*/
export function styledElement(elem = "div", rules = {}, options = {}) {
const element = document.createElement(elem)
@jukben
jukben / fib.js
Last active June 5, 2017 14:45
Fib
// using iteration
const fib = (number) => {
const results = [0, 1]
for (let i = 0; i <= number - 2; i++){
results[i+2] = results[i+1] + results[i];
}
return results[number];
}
@jukben
jukben / mock-chalk.js
Last active November 8, 2017 23:53
We had to mock Chalk for CI – Proxy FTW
/**
* Chalk mock for CI
*
* chalk.whatever.color.red("text") => "text"
* chalk.i.have.to.go.sleep("NOW!)" => "NOW!"
*/
module.exports = new Proxy(
{},
{
@jukben
jukben / React-Native-First-Aid-Manual.md
Last active November 15, 2017 18:07
Your React Native project got broken? Try this check list.

Have your React Native project got broken?

  1. Restart XCode
  2. Reinstall Pods cd ios/ && pod install
  3. rm -fr node_modules && yarn
  4. Restart Mac
  5. Remove the whole project and clone it again
  6. Make step (or two) back. git reset @^^
@jukben
jukben / android_Fastlane
Last active October 28, 2021 10:51
Example of Circle CI config for React Native CI (Appcenter, Kotlin, Swift, RN 0.49+, Haul packager, signing via Match, be sure that you have set env MATCH_PASSWORD, FASTLANE_PASSWORD and SLACK_URL)
fastlane_version "2.64.1"
default_platform :android
platform :android do
lane :beta do
gradle(task: "assembleRelease")
appcenter_upload(
api_token: "",
@jukben
jukben / config
Last active April 8, 2019 16:18
Example config for GBCK
{
"url": "[email protected]:jukben/dotfiles.git",
"readme": "README.md",
"entities": [
{
"i": "~/.config/fish",
"o": ".config/fish",
"options": {
"noSymlinks": true
}
@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")
@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 / 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 / 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 :)