Skip to content

Instantly share code, notes, and snippets.

@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active May 1, 2021 10:16
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss
@keyboardsurfer
keyboardsurfer / .gitignore
Last active December 11, 2019 01:55
Android gitignore
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# built application files
*.apk
*.ap_
*.jar
!gradle/wrapper/gradle-wrapper.jar
# lint folder
@iheanyi
iheanyi / NowArrayAdapter.java
Last active February 10, 2019 17:32
Google Now Cards Layout XML. list_item.xml can be customized to your heart's content . . . Also, you can implement the following with DragSortListView for swiping to delete, reordering, and whatnot.
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created September 7, 2016 20:54
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@khattaksd
khattaksd / seed.sql
Created September 22, 2023 00:19
Supabase Seed Users for local development & testing
-- supabase/seed.sql
--
-- create test users
INSERT INTO
auth.users (
instance_id,
id,
aud,
role,
email,
@Shpigford
Shpigford / .cursorrules
Last active April 25, 2025 01:22
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@pirate
pirate / uuid7.py
Last active January 25, 2025 15:11
Pure python all-in-one UUIDv7 Implementation with graceful degradation between ms, µs, and ns timestamp precision
#!/usr/bin/env python3
# A single-file pure-python implementation of UUIDv7: (e.g. 01941230-851a-77fd-9b0b-8c8eac3b2d23)
# - makes sure UUIDv7s are always generated in alphabetic order (using system time + nanoseconds + extra monotonic random bits)
# - store millisecond, microsecond, nanosecond / variable precision timestamps all using same format
# - graceful degradation in precision, falls back to monotonic urandom bytes depending on user-provided timestamp precision
# - fully compatible with standard UUIDv7 spec (48 bit millisecond unix epoch time with rand_a & rand_b monotonic randomness)
# - allows you to generate a UUIDv7 with a given timestamp (of any precision), and parse the timestamp back out from any UUIDv7
# - helps guarantee that UUIDv7s generated back-to-back in the same thread are always monotonically sortable
# - helps lower the risk of UUIDv7s colliding with other UUIDv7s generated in other threads / on other machines