Skip to content

Instantly share code, notes, and snippets.

@aileftech
aileftech / hex-colors.txt
Created October 1, 2022 18:10
A Bash one-liner to produce a list of HEX color codes that read like (supposedly) valid English words
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}'
#ACAD1A
#B0BB1E
#DEBB1E
#AB1DED
#ACAC1A
#ACCEDE
#AC1D1C
#BAB1ED
#BA0BAB
GitHub changed the world of open-source.
In the beginning it brought together the disconnected programmers who always wanted to work on something with other like-minded people.
In the present it's no longer the foreground. Businesses and professionals connect and the profiles become a bragging ground.
The GH PR system is stretched to its limits. During the early days this was ok: PRs were few and far between. It worked.
I've changed, and so has GitHub. As I grow older I care more about my impact and personal data responsibility. I care about FOSS work being used for profit.
@Treeki
Treeki / TurnipPrices.cpp
Last active July 8, 2024 02:08
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@tomhicks
tomhicks / plink-plonk.js
Last active July 26, 2024 01:10
Listen to your web pages
@craigtommola
craigtommola / ImBeingStopped.rtf
Last active April 22, 2021 01:37
Instructions for a "Hey Siri I'm Being Stopped" shortcut for iOS
Hey Siri “I’m Being Stopped”
Instructions to setup iOS Siri Shortcut
1. Make sure your iPhone has the Shortcuts app installed
⁃ https://apps.apple.com/us/app/shortcuts/id915249334
2. Make sure the person you want to notify is saved as a contact on your phone, using their cell number, and they can receive MMS (i.e. video via text message)
3. Open the Shortcuts app and tap “Create Shortcut”
4. Tap the blue circle (with three dots) to the right of “New Shortcut” to rename the Shortcut to whatever you wish your Siri command to be. For this example, we’ll use “I’m being stopped”. Tap “Done”
5. Our Message Action:
⁃ Tap “Add Action”
@salamanders
salamanders / speedup.sh
Last active June 25, 2023 22:45
Speed up video 64x with frame blending/averaging using ffmpeg
# Simple 4x speedup, force to 60fps.
/c/bin/ffmpeg/bin/ffmpeg.exe -r 60 -i thefile.mkv -vf "tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.25*PTS" -r 60 -c:v mpeg4 -q:v 1 -an thefile_4x.mp4
# Force input to 60fps. blend 16, and pick 1 of each 16. (do we do extra work for the other 15?) Set PTS to 1/16th of "original". Encode very high quality.
ffmpeg -r 60 -i molt.mp4 \
-vf "crop=in_h:in_h,tmix=frames=16:weights='1',select='not(mod(n\,16))',setpts=0.0625*PTS" \
-c:v libx265 -crf 18 -an molt16.mp4
# I still like the original. Match the "-r NN" to the source frame rate.
@arantius
arantius / red-border.user.js
Created September 7, 2017 14:06
A super simple user script with an unobtrusive way of being clear that it's running.
// ==UserScript==
// @name Red Border
// @description A super simple user script with an unobtrusive way of being clear that it's running.
// @namespace test
// @include http*
// @version 1
// @grant none
// ==/UserScript==
document.body.style.border = '3px dashed red';
@mzheng
mzheng / venmo_csv.txt
Last active August 27, 2021 16:01
Download Venmo Transactions as CSV
Prerequisite
JQ: brew install jq
Chrome/Safari Inspector
Log in and open https://venmo.com/#yours
Open Chrome/Safari Inspector
Go to Network Tab and filter for 'feed'
Right click and Save "feed" as "venmo_feed.json"
Run in Terminal:
cat venmo_feed.json | jq '.data[] | {actor: .actor.name, target: .transactions[0].target.name, type: .type, message: .message, date: .created_time, amount: .transactions[0].amount}' | jq -s -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > venmo_feed.csv
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pizzarob
pizzarob / 01_DropZone.jsx
Last active July 12, 2024 07:05
HTML5 Drag and Drop File Upload React Component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const ANIMATION_DURATION = 1000;
class BatchDropZone extends React.Component {
static propTypes = {