Skip to content

Instantly share code, notes, and snippets.

View vonovak's full-sized avatar
👋
Open to opportunities

Vojtech Novak vonovak

👋
Open to opportunities
View GitHub Profile
//
// YeetJSIUTils.h
// yeet
//
// Created by Jarred WSumner on 1/30/20.
// Copyright © 2020 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <jsi/jsi.h>
@jkrems
jkrems / index.md
Last active November 3, 2023 14:34
JavaScript: Classic Scripts vs. Modules vs. CommonJS

JavaScript File Format Differences

There's the pervarsive notion that all JS is created equal and that there's only minor and easily detectable differences between the various file formats used to author JavaScript. This is correct, from a certain point of view.

A certain point of view?

For many people writing JavaScript that gets passed into build tools,

@kelset
kelset / build-time-improvements.md
Last active June 21, 2023 19:25
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app

Intro

Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.

@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active April 24, 2024 11:35
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
import { useRef, useCallback, useEffect } from 'react';
// A callback that always closes over the latest data but keeps the same
// identity and will not be called after component unmounts
const useStableCallback = callback => {
const callbackRef = useRef();
const memoCallback = useCallback(
(...args) => callbackRef.current && callbackRef.current(...args),
[],
@getify
getify / 1.md
Last active October 15, 2020 01:44
BetterPromise: a strawman experiment in subclassing Promise and "fixing" a bunch of its awkward/bad parts

Some things that are "better" with this BetterPromise implementation:

  • BetterPromise # then(..) accepts a BetterPromise (or Promise) instance passed directly, instead of requiring a function to return it, so that the promise is linked into the chain.

    var p = BetterPromise.resolve(42);
    
    var q = Promise.resolve(10);
    
    p.then(console.log).then(q).then(console.log);
@iRoachie
iRoachie / resolver.md
Created September 4, 2017 13:26
Getting starting with module resolver

Babel Module resolver is a great tool we use to speed up development. Since es6 code has to go through babel anyway to compile to normal js, we can take advantage of this and remap the paths to files.

Firstly install the plugin. npm i -D babel-plugin-module-resolver

Add the paths you want to use to your .babelrc. Here's an example of how it could look with react native.

{
@parshap
parshap / node-modules-in-react-native.md
Last active November 15, 2023 11:15
Running Node Modules in React Native

Running Node Modules in React Native

How to use packages that depend on Node.js core modules in React Native.

See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.

Node.js Core Modules

// This file allows us to inspect the traffic going over the Native <-> JS bridge, and can be
// helpful for debugging. Setting this to true should never be committed to git
const ENABLE_BRIDGE_DEBUGGER = false; // <-- THIS SHOULD NOT BE TRUE IN MASTER!!!!
// if true, function arguments will get pretty printed
const PRETTY_PRINT = false;
// enable this if you want to ignore EVERY event, except for the ones that match the `FOCUSED_*`
// constants. If true, you configure what you want to see. If false, you configure what you DONT
// want to see.
@knowbody
knowbody / ex-navigation.md
Last active July 17, 2023 10:14
My exponent's ex-navigation docs/thoughts

Exponent - ex-navigation

This is for now, for my personal use only, things might not be correctly explained here. For the official docs please check: https://github.com/exponentjs/ex-navigation/blob/master/README.md

Navigation bar configuration

On every screen you can use the built-in navigation bar, you can add a title, left button, right button or change navigation bar’s style. All you need to do is pass appropriate params to navigationBar in the route configuration:

import React, { Component } from 'react';