Skip to content

Instantly share code, notes, and snippets.

@noman-land
noman-land / GCDLCMCache.sol
Created April 19, 2018 16:53 — forked from 3esmit/GCDLCMCache.sol
hacky gcd lcm solidity with cache
pragma solidity ^0.4.21;
contract GCDLCMCache {
mapping (bytes32 => uint256) public cache;
enum CacheType { GCD, LCM }
function gcd(uint256[] input)
@noman-land
noman-land / deploy.yml
Created August 5, 2022 22:58 — forked from miguelmota/deploy.yml
Github actions deploy to IPFS and update Cloudflare TXT _dnslink subdomain example
name: deploy
on:
push:
branches:
- master
jobs:
set_environment:
outputs:
env_name: ${{ steps.setenv.outputs.env_name }}
@noman-land
noman-land / appify
Created January 2, 2024 21:11 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@noman-land
noman-land / open-vlc-m3u8-url-with-http.md
Created July 10, 2024 23:46 — forked from milesrichardson/open-vlc-m3u8-url-with-http.md
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,