Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
Digging into React Native

Lukas Kurucz usrbowe

🤓
Digging into React Native
View GitHub Profile
@usrbowe
usrbowe / react-native-kill-packager.sh
Created May 23, 2019
Kill background running packager for React Native
View react-native-kill-packager.sh
# 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 Nov 10, 2018
React Native Profiler
View App.js
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
Last active Oct 15, 2020
React Native Profiler
View .babelrc
{
"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 Nov 10, 2018
React Native Profiler
View App.js
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 Jun 15, 2018
Camelize string in Javascript / ES6 💪
View camelize.js
/* 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("")}`
);
};
View jumbo-test-html.html
<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 Jun 27, 2017
Delete all origin branches on GitHub
View branch-delete.js
// 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
bug in intersection observer polyfill
View intersection-observer.html
<!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;
You can’t perform that action at this time.