Skip to content

Instantly share code, notes, and snippets.

View LittleFox94's full-sized avatar
🏳️‍⚧️
trans rights are human rights

Mara Sophie Grosch LittleFox94

🏳️‍⚧️
trans rights are human rights
View GitHub Profile
@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@garbados
garbados / gist:f82604ea639e0e47bf44
Created July 27, 2014 23:07
Falsehoods Programmers Believe About Gender
  1. There are two and only two genders.
  2. Okay, then there are two and only two biological genders.
  3. Gender is determined solely by biology.
  4. Okay, it’s mostly determined by biology, right?
  5. Please tell me it’s determined by DNA.
  6. Gender can be reliably determined through visual means. After all, no man would ever wear a burka.
  7. Once gender is set, it never changes.
  8. Even if the gender can change, it will only change from the one value to the other value.
  9. Only one gender can be “active” at the same time.
  10. We’re tracking gender now, so we’ve always tracked it.
@cvan
cvan / set-up-chromium-keys.md
Last active March 19, 2024 10:44
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@wido
wido / rgw-bucket-stats.sh
Last active June 9, 2022 07:44
Ceph RADOS Gateway bucket statistics
#!/bin/bash
#
# Get the usage statistics of all RGW buckets
#
# Sort output with: ./rgw-bucket-stats.sh|sort -k 2 -n|tac
#
# Author: Wido den Hollander <wido@widodh.nl>
#
for BUCKET in $(radosgw-admin bucket list|python -c "import json,sys; [sys.stdout.write(bucket + '\n') for bucket in json.load(sys.stdin)]"); do
@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@joyeusenoelle
joyeusenoelle / NewYearSolstice.md
Last active December 24, 2023 19:02
Why isn't the New Year on the Winter Solstice?

“Why isn’t the new year on the winter solstice?”

The answer, honestly, is that the Romans had no fucking idea how to run a calendar.

Like, seriously, people notice "OCTOber" and "DECEMber" and say, "hey, those mean 'eight' and 'ten', but they're the 10th and 12th months, what's up with that?".

If you've got a little more history, you'll know that July and August are named after Julius and Augustus Caesar, and think, "oh, they added those two months and bumped the rest of the months back."

Nope. The Romans were way, way worse at calendars than that.

@arturo182
arturo182 / bom2grouped_csv_jlcpcb.xsl
Last active April 24, 2024 16:08
A KiCad BOM script for generating JLCPCB PCBA-compatible files!
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
Copyright (C) 2018, Kicad developers.
Copyright (C) 2019, arturo182.
GPL v2.
Functionality:
Generation of JLCPCB PCBA compatible BOM