Skip to content

Instantly share code, notes, and snippets.

@notwaldorf
notwaldorf / README.md
Last active January 4, 2025 16:51
A very minimal p5.js polyfill for when you want to write basic p5.js code but not import the whole kitchen sink.

Minimal p5 polyfill

This is a very minimal bit of polyfill code for when you want to use some basic p5.js code you wrote, but not pay the performance cost associated with importing the whole kitchen sink.

It basically implements some of the sintactic sugar I use the most from p5.js but using the Canvas api, so that I have the p5 api but without all the magic I'm probably not using in this particular sketch.

@Quasimondo
Quasimondo / hic_et_nunc_basic_scraper.py
Created March 10, 2021 11:23
This is a very basic no-frills scraper to retrieve the metadata and digital assets from all tokens minted on hicetnunc.xyz. I share this as a starting point for people who want to experiment with building alternative views on the works created on the platform or preserve the data. Feel free to improve upon this or add additional features.
import requests
import os
import ipfsApi
api = ipfsApi.Client(host='https://ipfs.infura.io', port=5001)
url = "https://better-call.dev/v1/contract/mainnet/KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton/tokens"
r = requests.get(url)
data = r.json()
@yaythomas
yaythomas / README.md
Last active February 27, 2025 09:24
convert flat hugo content pages to leaf bundles

convert hugo content files to page leaf bundles

This pipeline converts Hugo content pages to page leaf bundles.

From:

`-- content
    |-- about.md
    `-- post
 |-- content-1.md
@cmod
cmod / hugofastsearch.md
Last active April 17, 2025 23:32 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
@nolanlawson
nolanlawson / backup_twitter_media.py
Created December 4, 2017 00:36
Script to backup media (images) in a Twitter archive
#!/usr/bin/env python
# Given a Twitter archive, replace all references to Twitter hosted images with a downloaded local image.
# Usage: place in the directory of the Twitter export (at the same level as the index.html file) and run it.
# Note: doesn't work for video. Skips images that fail to download.
import errno
import os
import re
import requests
@sirtimid
sirtimid / wp_cleanup.php
Last active March 14, 2017 09:48
Cleanup wordpress of unwanted dashboard widgets and injected styles
<?php
// filter to remove TinyMCE emojis
if ( !function_exists( 'disable_emojicons_tinymce' ) ) {
function disable_emojicons_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
@sirtimid
sirtimid / auto-polylang-media.php
Last active April 10, 2021 17:16
Translate media automatically when using Polylang in Wordpress
<?php
if ( !function_exists( 'translate_all_media' ) ) {
function translate_all_media() {
global $polylang;
if(!$polylang) return;
// find languages
$langs = array();
@Arty2
Arty2 / ktimatologio.js
Last active March 12, 2023 18:59
A technique to capture large screenshots from http://gis.ktimanet.gr/
/*
Instructions for Firefox:
1. On Firefox, open http://gis.ktimanet.gr/wms/ktbasemap/default.aspx and zoom to your area of interest
2. Hit Shift + F4 to open the Scratchpad and paste the code below, then click on “Run” (Ctrl + R).
You may close the Scratchpad. There’s no need to save anything.
3. Input your desired image size on the prompt window (height equals width)
4. Refine your position, eg: zoom with the scrollbar or pad by click and drag
5. Capture a screenshot of the full page with Firefox’s built-in tools: https://screenshots.firefox.com/
Also works in Chrome but there’s no built-in way to capture the screenshot.
@Arty2
Arty2 / tabs_to_bottom.css
Last active November 5, 2023 19:58
Firefox CSS to move tabs and adress bar to bottom of window. Use with userChrome.css (works with Firefox 71+)
This script has moved to https://github.com/Arty2/userstyles