Skip to content

Instantly share code, notes, and snippets.

View mfazekas's full-sized avatar

Miklós Fazekas mfazekas

View GitHub Profile
@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 December 14, 2023 14:48
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({
@mfazekas
mfazekas / AnimatedLineString2.js
Created March 4, 2020 15:05
AnimatedLineString
export class AnimatedLineString2 extends AnimatedWithChildren {
constructor(line) {
super();
this.coordinates = line.coordinates.map(coord => [...coord]);
}
// eslint-disable-next-line class-methods-use-this
_onAnimationDone(animation, doneCB) {
return new Proxy(animation, {
@mfazekas
mfazekas / paranoia_rails_52rc2_issue.rb
Created March 23, 2018 19:17
Paranoia issue with rails 5.2.0.rc2
# frozen_string_literal: true
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do