Skip to content

Instantly share code, notes, and snippets.

View henrymoulton's full-sized avatar

Henry Moulton henrymoulton

View GitHub Profile
@sidferreira
sidferreira / WatermelonProvider.js
Last active June 14, 2023 14:50
WatermelonDB preloaded db
import React, { ReactChild } from 'react';
import { Database } from '@nozbe/watermelondb';
import { getWatermelon } from 'app/utils/DBWatermelonOld/DBWatermelonOld';
import DatabaseProvider from '@nozbe/watermelondb/DatabaseProvider';
const WatermelonProvider = (props) => {
const watermelonRef = React.useRef();
const [database, setDatabase] = React.useState();
if (!watermelonRef.current) {
@derekstavis
derekstavis / FastList.tsx
Last active June 19, 2024 03:55 — forked from vishnevskiy/FastList.js
Discord's FastList, but in TypeScript
import { forEachObjIndexed } from "ramda";
import * as React from "react";
import {
Animated,
ScrollView,
View,
ViewStyle,
LayoutChangeEvent,
NativeScrollEvent,
} from "react-native";
import { StatusBar } from 'react-native';
import { Audio, FileSystem } from 'expo';
export default class CachedAudio {
constructor(uri) {
this.uri = uri;
this.fileUri = null;
this.sound = null;
this.downloadResumable = null;
}
const admin = require("admin");
function getFirebaseUser(req, res, next) {
console.log("Check if request is authorized with Firebase ID token");
if (
!req.headers.authorization ||
!req.headers.authorization.startsWith("Bearer ")
) {
console.error(
"No Firebase ID token was passed as a Bearer token in the Authorization header.",
@staltz
staltz / introrx.md
Last active June 18, 2024 06:15
The introduction to Reactive Programming you've been missing
@bmcminn
bmcminn / greasestarter.user.js
Last active December 21, 2022 22:01
JS: A simple boilerplate Grease/Tampermonkey script. This starter script aliases a custom jQuery instance on the page so you can start doing some fancy dom manipulation stuffs with absolutely no consequences.
// ==UserScript==
// @name SCRIPT_NAME_HERE
// @namespace NAMESPACE
// @version 0.1
// @description WIDGET_DESCRIPTION_HERE
// @match http*://*/*
// @include http*://*/*
// @copyright 2013+, YOURNAME
// ==/UserScript==