Skip to content

Instantly share code, notes, and snippets.

@milesrichardson
milesrichardson / open-vlc-m3u8-url-with-http.md
Created July 10, 2024 21:50
How to use VLC to watch m3u8 playlist at URL with custom HTTP referrer and user agent

Imagine this: it's Sunday afternoon at 1pm, and you want to watch some live content. But you don't have a TV subscription. So you do a little Googling, and eventually you find yourself on a sketchy website where you can watch the content you're looking for. But while the website has a video player, it's surrounded by advertisements, and probably a cryptominer too. You don't want this website eating your CPU for 2 hours while you're watching your favorite Sunday afternoon content.

Wouldn't it be nice if you could watch that video in VLC instead? Then you can close the sketchy website and still watch your content. It's like having your cake and taking a bite of it too!

Here's how you do it:

  1. Capture the m3u8 request in dev tools. Open the site (or just the iframe, if possible) in DevTools and click "play." Search the network tab for m3u8 and grab the first request.

  2. Run VLC with command line flags to set the User Agent and Referrer. From the request body, you need to copy the requested URL,

@flipeador
flipeador / unicode-characters-emojis.md
Last active January 24, 2025 17:28
Unicode characters and emojis.

Unicode Characters & Emojis

A character is an overloaded term that can mean many things. This gist will briefly touch on the differences between Code Point, Code Unit, Grapheme and Glyph, with a particular focus on emojis.

Tip

Use [Full Emoji Support For All Websites][emoji] to ensure correct rendering of all emoji graphemes on any website.

Code Point

@pengowray
pengowray / output-shortlist-focus.txt
Last active October 12, 2022 06:34
Worst combos ordered by most short list solutions: List of the most ambiguous four-letter wordle combos, ordered by most number of possible short list solutions. Count is given as ('short list solutions' + 'additional long list solutions' = 'total'). A '*' means the guess is allowed but not in the short list of possible answers. Source: https://…
_IGHT (9 + 6 = 15): eight fight light might night right sight tight wight *aight *bight *dight *hight *kight *pight
_OUND (8 + 1 = 9): bound found hound mound pound round sound wound *lound
_ATCH (7 + 3 = 10): batch catch hatch latch match patch watch *gatch *natch *ratch
_OWER (7 + 3 = 10): cower lower mower power rower sower tower *bower *dower *vower
SHA_E (7): shade shake shale shame shape share shave
_AUNT (6 + 2 = 8): daunt gaunt haunt jaunt taunt vaunt *naunt *saunt
_ILLY (6 + 2 = 8): billy dilly filly hilly silly willy *gilly *tilly
STA_E (6 + 2 = 8): stage stake stale stare state stave *stade *stane
_ATTY (6 + 1 = 7): batty catty fatty patty ratty tatty *natty
GRA_E (6 + 1 = 7): grace grade grape grate grave graze *grame
@mogelbrod
mogelbrod / babel.config.js
Last active December 5, 2023 22:18
Prevent core-js polyfills of APIs that should be supported by IE11 for general use (incomplete list)
module.exports = {
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
debug: false,
loose: true,
corejs: {
version: 3,
proposals: true,
},
@jforberg
jforberg / socp
Last active November 4, 2021 08:21
Stack overflow copy pasta
Welcome to Stack Overflow! Questions seeking debugging help ("why isn't this code working?") must
include the desired behavior, a specific problem or error and the shortest code necessary to
reproduce it in the question itself. Questions without a clear problem statement are not useful
to other readers. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve).
Welcome to Stack Overflow! Questions asking us to recommend or find a book, tool, software library,
tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract
opinionated answers and spam. Instead, [describe the problem](http://meta.stackoverflow.com/questions/254393)
and what has been done so far to solve it.
@markerikson
markerikson / render-logic.js
Last active January 1, 2024 06:20
React render function organization
// See https://blog.isquaredsoftware.com/presentations/react-redux-ts-intro-2020-12/#/36 for slides
// My basic render function structure:
function RenderLogicExample({
someBoolean, // 1) Destructure values from `props` object
someList,
}) {
// 2) Declare state values
const [a, setA] = useState(0);
const [b, setB] = useState(0);
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 27, 2025 05:39
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@gaearon
gaearon / connect.js
Last active May 3, 2025 05:27
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@Drixled
Drixled / type.css
Created May 1, 2016 02:12
Good vertical rythym typography
body {
font-family: Helvetica, Arial, sans-serif;
font-weight: 400;
font-style: normal;
font-size: 1.125rem;
line-height: 1.6875rem;
max-width: 760px;
padding: 1.6875rem;
margin: 0 auto;
}
@manigandham
manigandham / rich-text-html-editors.md
Last active April 16, 2025 18:28
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors