Skip to content

Instantly share code, notes, and snippets.

View shirakaba's full-sized avatar
💭
🧙‍♂️

Jamie Birch shirakaba

💭
🧙‍♂️
View GitHub Profile
export * from "./expo-nativescript-adapter.common";
export const NativeModulesProxy = {};
const provider = EXModuleRegistryProvider.new();
const moduleRegistry = provider.moduleRegistryForExperienceId(
"@sjchmiela/test"
);
const exportedModules = moduleRegistry.getAllExportedModules();
for (let i = 0; i < exportedModules.count; i++) {
<!--
- Add a 'Text' widget with the content below (set 'mode' to 'html').
- Make sure to enable JS parsing for this widget by setting the 'disable_sanitize_html' property to 'true' in your grafana.ini.
- For more detailed info, check out fi. https://www.worldometers.info/coronavirus/
- STAY SAFE FOLKS!
-->
<center>
<div style="font-size: 20px">🦠<span id="confirmed"/></div>
<div style="font-size: 16px">💀<span id="deaths" /><span id="deathrate" style="color: #555; padding-left: 8px"/></div>
@shirakaba
shirakaba / .rescriptrc.js
Created May 21, 2020 21:38
Old, messy rescript config for making react-scripts work with React Native Web
const path = require('path');
const { getPaths, edit, getWebpackPlugin, replaceWebpackPlugin, removeWebpackPlugin, prependWebpackPlugin, paths, appendWebpackPlugin } = require('@rescripts/utilities');
const getModule = (name) => path.resolve(path.join('node_modules', name));
/* With reference to: https://github.com/expo/expo-cli/blob/master/packages/webpack-config/src/webpack.config.ts */
module.exports = config => {
const isEnvDevelopment = config.mode === "development";
const isEnvProduction = config.mode === "production";
@shirakaba
shirakaba / .babelrc
Created May 21, 2020 21:41
Babelrc file for getting React Native Web to work with react-scripts
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
["@babel/plugin-proposal-numeric-separator", {}]
]
}
@shirakaba
shirakaba / AppDelegate.swift
Last active May 24, 2020 15:08
LinguaBrowse Mac (React Native macOS + iOS Swift app) old AppDelegate
//
// AppDelegate.swift
// LinguaBrowse
//
// Created by jamie on 07/06/2018.
// Copyright © 2018 Facebook. All rights reserved.
//
import Foundation
import StoreKit
@shirakaba
shirakaba / react_native_firebase_dynamic_links_notes.md
Last active June 4, 2020 00:11
Strategy for fixing React Native Firebase Dynamic Links
@shirakaba
shirakaba / es_cookbook.md
Last active November 13, 2020 22:28
ElasticSearch cookbook

List the indices

curl -XGET 'localhost:9200/_all/_settings'
{
  "logstash-my-project-2020.04.16": {
    "settings": {
@shirakaba
shirakaba / README.md
Last active May 10, 2021 21:04
Running NativeScript on Apple Silicon via Rosetta (x86 emulation)

This guide will show you how to provision an Apple Silicon machine to run a NativeScript app via Rosetta (x86 emulation). It may soon become possible to run it natively, but I believe that's pending this PR, so I had to go with Rosetta for the time being.

I did this setup on a borrowed M1 Mac Mini, so a few things had been provisioned already, but I'll do my best to retrace setup steps below.

I referenced the iOS-related setup steps in the NativeScript Advanced Setup: macOS docs. They're still up-to-date, except for referring to an older version of Node.js. Specifically, what I did was:

1) Install Homebrew:

x86 Homebrew was provisioned already on the machine, like so:

@shirakaba
shirakaba / react-native-in-nativescript-dump.md
Created February 11, 2021 22:55
react-native:0.63.4.aar selector dump

Here's what I ran:

declare var com: any;
const visitedValues = new Set();

function eachRecursive(path, value){
    if(visitedValues.has(value)){
        // Crude protection against following circular references in an infinite loop
        console.log(`${path} [Already visited, so won't recurse]`);
@shirakaba
shirakaba / MWE.svelte
Last active April 28, 2021 16:40
Svelte store contract for one API of a class
<script>
import { writable } from 'svelte/store';
class TransactionManager {
constructor(){
this.transactionCount = -1;
this.transactionQueue = [];
this._transactionIsInFlight = writable(false);
}
startTransaction(){