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

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 / 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};
}
@Bigismall
Bigismall / svg-html-iframe.svg
Last active March 21, 2021 16:50 — forked from tarwin/svg-html-iframe.svg
SVG: Embedding HTML (and an IFrame)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Bigismall
Bigismall / README.md
Created January 12, 2021 16:50 — forked from aponxi/README.md
Simple chat script php

Very simple jQuery AJAX PHP chat

jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

In other words it makes everything really simple. For this example you will need this file.

chat.sql

First step is creating a database.

@Bigismall
Bigismall / easings.css
Created July 21, 2020 15:19 — forked from argyleink/easings.css
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);