Skip to content

Instantly share code, notes, and snippets.

View Bigismall's full-sized avatar
🚂

Slawomir Rodak Bigismall

🚂
View GitHub Profile
@Bigismall
Bigismall / Dockerfile
Created January 19, 2024 08:03 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@Bigismall
Bigismall / geofs-aircratf-navigation.css
Created October 19, 2023 15:12
Custom styles for GeoFS "Aircraft Menu" - just to reduce jumping
/*For community contributed list items */
.geofs-aircraft-list.geofs-visible > li.geofs-list-collapsible-item.geofs-list-item-expanded {
height:auto;
max-height:max-content;
}
.geofs-aircraft-list.geofs-visible > li.geofs-list-collapsible-item.geofs-list-item-expanded li {
min-height: 40px;
height: 40px;
}
@Bigismall
Bigismall / reset.css
Created September 20, 2023 05:54
A (more) Modern CSS Reset
/* Taken from: https://andy-bell.co.uk/a-more-modern-css-reset/ */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Prevent font size inflation */
html {
@Bigismall
Bigismall / shared-translations.json
Last active July 27, 2023 13:27
Shared translations - new structure
{
"general": {
"dateTime": {
"months": {
"april": "April",
"august": "August",
"december": "December",
"february": "February",
"january": "January",
"july": "July",

Creating an Expo app in 2023

12th July, 2023. I'm going to try creating an iOS app called Paranovel, using Expo. My environment for mobile app dev (Xcode, Ruby, etc.) should be in reasonably good shape already as I frequently develop with React Native and NativeScript.

Creating the app

Go to https://docs.expo.dev, and see the Quick Start: npx create-expo-app paranovel

This runs with no problem, then I get this macOS system popup:

const API_URL = "https://api.openai.com/v1/chat/completions";
const MAX_TOKENS = 1500;
const TEMPERATURE = 0.5;
const SYSTEM_PROMPT = 'Act as assistant';
const MESSAGES = ["hello", "hi!", "how are you?"];
async function openAICompletion(msg) {
const options = {
method: "POST",
headers: {
import * as React from "react";
import { useRef, useCallback, useInsertionEffect } from "react";
let _dispatcher = null;
function getCurrentDispatcher() {
return React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
.ReactCurrentDispatcher.current;
}
@Bigismall
Bigismall / index.html
Created April 14, 2022 11:00 — forked from mcxiaoke/index.html
detect app installed in browser
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>
@Bigismall
Bigismall / IntegerNumberFormat.js
Last active June 25, 2021 11:40
format number value
CAPP.util.IntegerNumberFormat = (function () {
return function (value) {
return String(value).replace(/(.)(?=(\d{3})+$)/g, "$1 ");
};
}());
@Bigismall
Bigismall / getTileFromLatLon.js
Last active June 25, 2021 11:39 — forked from spite/gist:051604efd1d971ab4b6ef1bc1ae2636e
zoom - lat -lon to mapzen/tilezen tile
function getTileFromLatLon(zoom, lat, lon) {
const width = Math.pow(2, zoom);
const height = Math.pow(2, zoom);
const latRad = (lat * Math.PI) / 180;
const x = ~~((width * (lon + 180)) / 360);
const y = ~~(((1 - Math.asinh(Math.tan(latRad)) / Math.PI) / 2.0) * height);
return {zoom, x, y};
}