Skip to content

Instantly share code, notes, and snippets.

@intergalacticspacehighway
intergalacticspacehighway / PinchToZoom.tsx
Last active March 10, 2025 21:02
Pinch to zoom reanimated + gesture handler
import React, { useMemo, useState } from "react";
import { LayoutChangeEvent, StyleSheet } from "react-native";
import {
PinchGestureHandler,
PinchGestureHandlerGestureEvent,
} from "react-native-gesture-handler";
import Animated, {
useAnimatedGestureHandler,
useAnimatedStyle,
useSharedValue,
@h4de5
h4de5 / _toshiba-api.php
Last active October 16, 2023 19:45
Toshiba AC API Client - Get status and settings from Toshiba AC Services (used e.g. in RAS-18PKVSG-E + RAS-18PAVSG-E + WIFI Adapter RB-N103S-G)
#!/usr/local/bin/php73
<?php
$username = "YOUR_USERNAME";
$password = "YOUR_PASSWORD";
/**
* @param string $url
* @param string $post
* @param string $token
@philhawksworth
philhawksworth / dpr-example-fetch-and-render-on-demand.js
Created May 4, 2021 10:02
Example of an implementation using Netlify' On Demand Builder functions for DPR
require('dotenv').config();
const { builder } = require("@netlify/functions");
// Use the same page template our SSG uses dureing the build
const pageTemplate = require('../../src/site/_includes/layouts/idea.11ty.js');
const {
DATABASE_URL,
SUPABASE_SERVICE_API_KEY
@eveningkid
eveningkid / react-native-shared-elements_facebook-marketplace.jsx
Created March 24, 2021 10:22
React Native Shared Elements: Facebook Marketplace Example
// Expo SDK40
// @react-native-community/masked-view: 0.1.10
// @react-navigation/native: ^5.9.3
// @react-navigation/stack: ^5.14.3
// react-native-gesture-handler: ~1.8.0
// react-native-reanimated: ~1.13.0
// react-native-safe-area-context: 3.1.9
// react-native-screens: ~2.15.2
// react-native-shared-element: 0.7.0
// react-navigation: 4
@nandorojo
nandorojo / _app.tsx
Last active August 2, 2022 16:12
React Native Web + Next.js Scroll Restoration
// pages/_app.js
import ReactNativeNextJsScrollRestore from '../react-native-next-scroll-restore'
import { useEffect } from 'react'
function MyApp({ Component, pageProps }) {
useEffect(() => {
const unsubscribe = ReactNativeNextJsScrollRestore.initialize()
return () => {
@ScottHelme
ScottHelme / lists.txt
Created January 13, 2021 10:57
My Pi-hole blocklist list.
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts https://mirror1.malwaredomains.com/files/justdomains http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt https://hosts-file.net/ad_servers.txt https://v.firebog.net/hosts/AdguardDNS.txt https://adaway.org/hosts.txt https://v.firebog.net/hosts/Easyprivacy.txt https://v.firebog.net/hosts/Prigent-Ads.txt https://zerodot1.gitlab.io/CoinBlockerLists/hosts https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/ocsp.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/crl.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts https://www.malwaredomainlist.c
@tkadlec
tkadlec / perf-diagnostics.css
Last active March 20, 2025 08:41
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@orta
orta / review.md
Created November 5, 2020 21:10
Orta's self review - late 2020

Core Priorities

  1. Lower the barrier of entry to adopting and understanding TypeScript. North star.

  2. Understand the TypeScript Codebase enough to provide useful API documentation and fix bugs. Validated by having a more comprehensive set of tools for people to understand how the language and tooling works.

  3. Make contributing to TypeScript easier, and reduce the amount of work maintainers need to do. Validated probably by the number of open PRs, and the number of external contributors per release.

  4. Make it easier to people wanting to build tooling around TypeScript. Validated by seeing more usage of tools like the community discord, people shipping tools with TypeScript support by default etc.

@jayphelps
jayphelps / settings.json
Last active March 28, 2022 17:10
Modifications on top of "Community Material Theme Palenight" Before and after: https://twitter.com/_jayphelps/status/1259321038728560642?s=20
// Modify your settings.json to add these. Customize further how you prefer.
{
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.tabCloseButton": "off",
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#ffffff06",
"editor.foreground": "#acb3db",
"selection.background": "#89DDFF",
"progressBar.background": "#89DDFF",
"textLink.foreground": "#89DDFF",