Skip to content

Instantly share code, notes, and snippets.

View mfazekas's full-sized avatar

Miklós Fazekas mfazekas

View GitHub Profile
@mfazekas
mfazekas / App.js
Created May 18, 2026 12:18
React 18 Bailout Demo — Issue #230 explainer (import into codesandbox.io)
import React, { useState, useRef, useEffect } from "react";
const S = {
app: { fontFamily: "system-ui, sans-serif", background: "#0f1117", color: "#e4e4e7", minHeight: "100vh", padding: "32px 20px" },
box: { maxWidth: 720, margin: "0 auto" },
h1: { fontSize: 24, marginBottom: 4 },
h2: { fontSize: 18, color: "#60a5fa", margin: "24px 0 12px" },
dim: { color: "#8b8d97", marginBottom: 24, fontSize: 14 },
sec: { background: "#1a1d27", border: "1px solid #333640", borderRadius: 12, padding: 20, marginBottom: 20 },
btn: { fontFamily: "inherit", fontSize: 13, padding: "8px 16px", borderRadius: 8, border: "1px solid #333640", background: "#252830", color: "#e4e4e7", cursor: "pointer", marginRight: 8, marginBottom: 8 },
@mfazekas
mfazekas / app-csb.js
Created May 18, 2026 12:18
React Bailout Demo — Issue #230 explainer
import React, { useState, useRef, useEffect } from "react";
const S = {
app: { fontFamily: "system-ui, sans-serif", background: "#0f1117", color: "#e4e4e7", minHeight: "100vh", padding: "32px 20px" },
box: { maxWidth: 720, margin: "0 auto" },
h1: { fontSize: 24, marginBottom: 4 },
h2: { fontSize: 18, color: "#60a5fa", margin: "24px 0 12px" },
dim: { color: "#8b8d97", marginBottom: 24, fontSize: 14 },
sec: { background: "#1a1d27", border: "1px solid #333640", borderRadius: 12, padding: 20, marginBottom: 20 },
btn: { fontFamily: "inherit", fontSize: 13, padding: "8px 16px", borderRadius: 8, border: "1px solid #333640", background: "#252830", color: "#e4e4e7", cursor: "pointer", marginRight: 8, marginBottom: 8 },
@mfazekas
mfazekas / index.ts
Created August 3, 2024 18:26
Parse typescript types and generate code using ts-morph and ejs
import { Project } from 'ts-morph';
import ejs from 'ejs';
import type { Type, ts } from 'ts-morph';
import fs from 'fs';
const project = new Project();
let tamagui_root = "../tamagui";
project.addSourceFileAtPath(`${tamagui_root}/node_modules/@types/react/index.d.ts`);
@mfazekas
mfazekas / ComponentFC-useRef.tsx
Last active July 20, 2022 19:29
ComponentFC useRef
/* eslint-disable react-native/no-inline-styles */
import React, {
Component,
useRef,
useImperativeHandle,
forwardRef,
} from 'react';
import { View, Button, Text } from 'react-native';
class ComponentC extends React.Component<{ name: string }> {
@mfazekas
mfazekas / samsung_ml_1670_bigsur.md
Last active May 25, 2026 14:57
Samsung ML-1670 on BigSur
import UIKit
import Mapbox
class ViewController: UIViewController, MGLMapViewDelegate {
var mapView : MGLMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
createUI()
@mfazekas
mfazekas / BugReportExample.js
Created June 8, 2020 15:52
Bug report example for point annotation loop crash
import React from 'react';
import MapboxGL from '@react-native-mapbox-gl/maps';
import {Platform, SafeAreaView, StyleSheet, View} from 'react-native';
import {point, lineString as makeLineString} from '@turf/helpers';
//import Svg, {Path} from 'react-native-svg';
// const MAPBOX_GL_ACCESS_TOKEN = 'CHANGE_ME';
const ROUTE_POINTS = [
{
@mfazekas
mfazekas / logcat lib-main.so
Created April 2, 2020 09:39
lib-main.so arch issue
```
2020-04-02 11:21:15.798 10842-10842/? I/mapboxglexampl: Not late-enabling -Xcheck:jni (already on)
2020-04-02 11:21:15.855 10842-10842/? I/mapboxglexampl: Unquickening 13 vdex files!
2020-04-02 11:21:15.860 10842-10842/? W/mapboxglexampl: Unexpected CPU variant for X86 using defaults: x86
2020-04-02 11:21:16.447 10842-10842/com.rnmapboxglexample I/mapboxglexampl: The ClassLoaderContext is a special shared library.
2020-04-02 11:21:17.211 10842-10842/com.rnmapboxglexample D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-04-02 11:21:17.212 10842-10842/com.rnmapboxglexample D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2020-04-02 11:21:17.474 10842-10842/com.rnmapboxglexample D/SoLoader: init start
2020-04-02 11:21:17.478 10842-10842/com.rnmapboxglexample D/SoLoader: adding system library source: /vendor/lib
@mfazekas
mfazekas / RouteCoordinatesArray.js
Created March 6, 2020 19:18
Example CoordinatesArray subclass
class RouteCoordinatesArray extends Animated.CoordinatesArray {
newCoordAnimator(config, origCoords) {
const {along} = config;
return {
dist: along[0],
distconf: along[1],
calculate(progress, coords) {
const currentDist = progress * this.dist;
@mfazekas
mfazekas / AnimatedCoordinateArrayExample.js
Created March 4, 2020 15:27
AnimatedCoordinateArray support
this.state = {
...
coordinates: new MapboxGL.AnimatedCoordinateArray([[lon + delta, lat], [lon, lat], [lon, lat + delta]])
...
}
...
this.state.coordinates
.timing({