Skip to content

Instantly share code, notes, and snippets.

@danawoodman
danawoodman / How to allow the file picker AND camera capture on Android.md
Last active January 17, 2025 13:22
How to allow the file picker AND camera capture on Android

Allow photo album AND the camera

On Android devices, if you want to create a file input that prompts the user to either choose an image from their photo album or take a picture with their camera, you'll need this basically undocumented capture attribute added to your input's accept property:

<input type="file" accept="image/*;capture=camera" />
@bia-pain-bache
bia-pain-bache / worker.js
Created January 13, 2024 14:55
Worker Test
// @ts-nocheck
// <!--GAMFC-->version base on commit 43fad05dcdae3b723c53c226f8181fc5bd47223e, time is 2023-06-22 15:20:02 UTC<!--GAMFC-END-->.
// @ts-ignore
import { connect } from 'cloudflare:sockets';
// How to generate your own UUID:
// https://www.uuidgenerator.net/
let userID = 'XXXX';
const proxyIPs = [
@ChenYFan
ChenYFan / ip.txt
Created May 14, 2021 11:51
Vercel All IP
34.95.57.145 [加拿大 魁北克省蒙特利尔 Google 云计算数据中心]
13.49.54.242 [瑞典 斯德哥尔摩 Amazon 数据中心]
18.178.194.147 [日本 东京都东京 Amazon 数据中心]
52.79.72.148 [韩国 首尔 Amazon 数据中心]
35.180.16.12 [法国 巴黎 Amazon 数据中心]
18.206.69.11 [美国 弗吉尼亚州阿什本 Amazon 数据中心]
52.76.85.65 [新加坡 Amazon 数据中心]
18.130.52.74 [英国 伦敦 Amazon 数据中心]
35.202.100.12 [美国 Merit 网络公司]
35.195.188.93 [比利时 瓦隆大区圣吉斯兰 Google 云计算数据中心]
@sindresorhus
sindresorhus / esm-package.md
Last active January 17, 2025 13:22
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@squarism
squarism / iterm2.md
Last active January 17, 2025 13:21
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@fjctp
fjctp / README.md
Last active January 17, 2025 13:20
RPi Zero W kiosk

Summary

Setup RPi Zero W as a kiosk

Step

  1. write Raspbian Lite image to a SD card
  2. enable ssh
touch /boot/ssh
  1. setup WiFi
@pkkid
pkkid / sort-photos-by-month.py
Created April 3, 2024 23:09
Sort Photos by Month
#!/usr/bin/python3
"""
Sort Photos by Month.
install python3-pil
"""
import logging, datetime
import argparse, os, sys
import hashlib
from PIL import Image
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active January 17, 2025 13:19
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@karpathy
karpathy / min-char-rnn.py
Last active January 17, 2025 13:19
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@kangarko
kangarko / README.md
Last active January 17, 2025 13:18
15-Minute Minecraft Plugin Tutorial For 1.8.8 - 1.21

15-Minute Minecraft Plugin Tutorial For 1.8.8 - 1.21

In this new Minecraft plugin development guide, I'll show you how to make Minecraft plugins for Bukkit, Spigot and Paper.

This guide covers Minecraft plugins for 1.8.8 to 1.21.

We'll be using IntelliJ with a dedicated extension for Minecraft plugin development to make this process fast and easy.

Do you want a complete step-by-step tutorial on developing your own Minecraft plugins? Click here for a full Minecraft plugin development training.