Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / rAF.js
Last active May 28, 2025 23:25
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@pesterhazy
pesterhazy / indexeddb-problems.md
Last active May 28, 2025 23:20
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

@khanhduytran0
khanhduytran0 / LC research issue 524.md
Last active May 28, 2025 23:18
LiveContainer multitask external keyboard input research

Recap

As you may have known, we recently managed to bring multitask to LiveContainer. This originally came from FrontBoardAppLauncher which was reverse engineered of various Apple apps: ClarityBoard, SpringBoard, Xcode PreviewShell, etc. A quick recap of how we worked on it:

  • I began reverse engineering said apps to study how to use various Private API of FrontBoard, RunningBoardServices and UIKit, resulted in MySystemShell and FrontBoardAppLauncher
  • I found app could spawn multiple processes thanks to the writeup of NSExtension
  • We found we could extend memory limit by setting a hidden NSExtensionPointIdentifier

However, as more and more people get to try it, we were reported that physical keyboard input wouldn't work. (LiveContainer/LiveContainer#524)

If anyone could figure it out, we will forever owe you.

# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 28, 2025 23:10
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This does not works in browser for non-video, non-activity quests! For stream/play quests use the desktop app!

Note

When doing stream quests, you need at least 1 other account in the vc!

How to use this script:

  1. Accept a quest under Discover -> Quests
@MPThLee
MPThLee / enableDiscordExperiments.js
Last active May 28, 2025 23:10
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@bsweger
bsweger / useful_pandas_snippets.md
Last active May 28, 2025 23:07
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@n1zyy
n1zyy / trackers.md
Last active May 28, 2025 23:07
Live Torrent Trackers

I was hacking on a little side-project, and found that most lists of torrent trackers are full of defunct trackers, or lots of dupes. I spent a while going through all the lists on the first few pages of Google, compiling them into a giant list, de-duping it, and then writing some quick code to test all of them.

Also, an aside: "/announce" on the end of a UDP URL doesn't make any sense. It's completely ignored at the protocol level, so I normalized entries by removing it.

I don't endorse any of these trackers, nor suggest you use them for committing copyright infringement.

Straight list

These trackers all respond to at least some scrape queries:

@ajstewartlang
ajstewartlang / gist:89dcdf01c4512a213141a16e9243626d
Last active May 28, 2025 23:04
Hacked together code for animated raincloud plots for N=20 and N=500 where no difference exists in underlying populations
# Usimg @micahgallen's nice raincloud plot code
# https://wellcomeopenresearch.org/articles/4-63
# and fork of benmarwick/geom_flat_violin.R code
# gganimate by Thomas Lin Pedersen - @thomasp85
devtools::install_github('thomasp85/gganimate')
library(tidyverse)
library(gganimate)
library(RColorBrewer)
@JulianGR
JulianGR / Markdown cheatsheet obsidian.md
Last active May 28, 2025 23:04
Custom Markdown cheatsheet for the note-taking app Obsidian

useful shortcuts

  • Ctrl + N: new note
  • Ctrl + E: toggle edit mode
  • Ctrl + enter: toggle checkbox
  • Ctrl + shift + F: search among all files
  • Ctrl + P: command pannel
  • Ctrl + [ or ] : change indentation of a list item
  • Alt + click to make multiple cursos

Internal linking