Skip to content

Instantly share code, notes, and snippets.

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

Jamie Birch shirakaba

💭
🧙‍♂️
View GitHub Profile
<!--
- 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 / 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 all APIs of a class
<script>
import { writable } from "svelte/store";
class TransactionManager {
constructor(){
this.transactionCount = -1;
this.transactionQueue = [];
this._transactionIsInFlight = writable(this);
}
@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(){
@shirakaba
shirakaba / custom store.js
Last active May 6, 2021 20:12
Svelte custom store example
import { writable, derived } from 'svelte/store';
function createCountries() {
const { subscribe, update } = writable([
{
name: "United Kingdom",
weather: "Cold",
description: "Nice tea",
},
{