Skip to content

Instantly share code, notes, and snippets.

View usrbowe's full-sized avatar
🤓
Digging into React Native

Lukas Kurucz usrbowe

🤓
Digging into React Native
View GitHub Profile
@usrbowe
usrbowe / README.md
Last active January 10, 2023 16:51
Flipper Marketplace - server

Flipper Marketplace

Used by the marketplace feature of Flipper: facebook/flipper#3491

This code needs a few changes to make it work, depending on the NPM server used. npmAdapter is written for verdaccio.co.

Usage

  1. Start server yarn && yarn start
  2. Enable marketplace in Flipper settings & set Martkeplace URL to http://localhost:4004/flipper-plugins
This file has been truncated, but you can view the full file.
@usrbowe
usrbowe / react-native-kill-packager.sh
Created May 23, 2019 04:06
Kill background running packager for React Native
# Find process running with port 8081 and later kill it.
# Tested on Mac OSx (should work on all unix based os as well)
kill $(lsof -t -i :8081)
@usrbowe
usrbowe / App.js
Created November 10, 2018 11:37
React Native Profiler
import React, {Component} from "react"
import {Text, View} from "react-native"
import firebase from "react-native-firebase"
const Profiler = React.unstable_Profiler
export default class App extends Component {
constructor(props) {
super(props)
this.trace = null
@usrbowe
usrbowe / .babelrc_59
Last active September 26, 2022 14:39
React Native Profiler <= RN 0.59
// React Native version <= 0.59
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
["module-resolver", {
"root": ["./"],
"alias": {
"ReactNativeRenderer-prod": "./node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-profiling",
"scheduler/tracing": "scheduler/tracing-profiling"
}
@usrbowe
usrbowe / App.js
Last active November 10, 2018 11:37
React Native Profiler
import React, {Component} from "react"
import {Text, View} from "react-native"
const Profiler = React.unstable_Profiler
export default class App extends Component {
logMeasurement = async (id, phase, actualDuration, baseDuration) => {
// see output during DEV
if (__DEV__) console.log({id, phase, actualDuration, baseDuration})
}
@usrbowe
usrbowe / camelize.js
Last active June 15, 2018 15:16
Camelize string in Javascript / ES6 💪
/* Transform dasherized, underscored string to camelCase */
const cameliseMe = (str, separator = "-") => {
const splitted = str.split(separator);
if (splitted.length === 1) return str;
return splitted.reduce(
(acc, [up, ...rest]) => `${acc}${up.toUpperCase() + rest.join("")}`
);
};
<main>
<section>
<hgroup>
<h1>h1 HTML5 Kitchen Sink</h1>
<h2>h2 Back in my quaint <a href='#'>garden</a></h2>
<h3>h3 Jaunty <a href='#'>zinnias</a> vie with flaunting phlox</h3>
<h4>h4 Five or six big jet planes zoomed quickly by the new tower.</h4>
<h5>h5 Expect skilled signwriters to use many jazzy, quaint old alphabets effectively.</h5>
<h6>h6 Pack my box with five dozen liquor jugs.</h6>
</hgroup>
@usrbowe
usrbowe / branch-delete.js
Created June 27, 2017 04:17
Delete all origin branches on GitHub
// Open console and run this script
[...document.querySelectorAll('.branch-delete')].forEach(button => button.click());
// URL to try
// https://github.com/--url-to-repository/branches/stale
@usrbowe
usrbowe / intersection-observer.html
Last active May 29, 2017 01:07
bug in intersection observer polyfill
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>IntersectionObserver</title>
<script src="https://cdn.polyfill.io/v2/polyfill.js?features=IntersectionObserver&min=false"></script>
<style>
html, body {
padding: 0;