Skip to content

Instantly share code, notes, and snippets.

View russellbits's full-sized avatar

Russell Warner russellbits

View GitHub Profile
const { data } = supabase.storage
.from('public-bucket')
.getPunlicUrl('folder/avatar-1.png', {
transform: {
width:100,
height:100,
resize:'cover' // Can be values of cover (defaul) | contain | fill
// cover crops to frame size | contain keeps aspect ratio inside frame | fill stretches image to fill frame
}
})
@russellbits
russellbits / genRGBString.js
Created December 12, 2022 00:09
Simple function to generate random rgb string of values
function genRGBString() {
const random256Color = (min, max) => min + Math.floor(Math.random() * (max - min + 1))
const r = random256Color(0, 255)
const g = random256Color(0, 255)
const b = random256Color(0, 255)
return `rgb(${r},${g},${b})`
}
@russellbits
russellbits / chunk.html
Created January 21, 2022 16:40
A simple raw html chunk
<h1>Get Skeptical</h1>
<h2>Category: Mind Control</h2>
<p>In a small but valiant effort to get the <a href="http://www.skepdic.com/">Skeptic's Dictionary</a> higher up in the PageRank system (at Google) I am linking to their entry on <a href="http://www.skepdic.com/chopra.html">Deepak Chopra</a> today. Consider the following statement:</p>
<blockquote>"Quantum healing is healing the bodymind from a quantum level. That means from a level which is not manifest at a sensory level. Our bodies ultimately are fields of information, intelligence and energy."</blockquote>
<p>I think we all have to look at men and women who make these kinds of (outrageous) claims&emdash;who offer no evidence but their own opinions and magical powers&emdash;in one of two lights. They are either so arrogant as to believe that their is no virtue in presenting evidence for their claims to fellow humans, <i>in which case they think you are an idiot</i>. Or they know (or suspect) that they are full of it and they are cynical enough to b
@russellbits
russellbits / linspace.js
Created July 15, 2021 17:42
Produces a linear set (array) of numbers that are evenly spaced along the number line.
/**
* Produces a sequence (array) of numbers that are evenly spaced along the number line.
* @param {Number} x1 The first number in the sequence
* @param {Number} x2 The last number
* @param {Number} n The number of numbers in the sequence
* @param {Number} d What decimal place to round each element of the sequence
* @return {Array} The linearly spaced sequence
*/
const linspace = (x1, x2, n, d) => {

How far away from your computer do you sit? If you're being good to yourself, you're not slouching, but sitting up straight with the screen about arm's length away. But if you're reading a book or a magazine, do you hold it at arm's length? So, it might be reasonable to argue that computer apps and web sites might be more legible/accessible by using a larger font size than the typical 12 point font found in books and magazines. That's a large part of the argument that D. Bnonn Tennant—information highwayman—makes over at Smashing Magazine. I'm not going to rehash his arguments, he makes an excellent case. Go read it. Take a look at the font size on this web site. Obviously I agree with him. I also noticed that the larger fon

@russellbits
russellbits / phylcert.json
Created June 19, 2018 22:35
Phylos Certified API call (transformed)
[
[{"subpop":"skunk","start":0,"end":1,"value":10},{"subpop":"skunk","start":1,"end":2,"value":10},{"subpop":"skunk","start":2,"end":3,"value":10},{"subpop":"skunk","start":3,"end":4,"value":10},{"subpop":"skunk","start":4,"end":5,"value":30},{"subpop":"skunk","start":5,"end":6,"value":10},{"subpop":"skunk","start":6,"end":7,"value":10},{"subpop":"skunk","start":7,"end":8,"value":30},{"subpop":"skunk","start":8,"end":9,"value":30},{"subpop":"skunk","start":9,"end":10,"value":10},{"subpop":"skunk","start":10,"end":11,"value":10},{"subpop":"skunk","start":11,"end":12,"value":10},{"subpop":"skunk","start":12,"end":13,"value":30},{"subpop":"skunk","start":13,"end":14,"value":10},{"subpop":"skunk","start":14,"end":15,"value":10},{"subpop":"skunk","start":15,"end":16,"value":20},{"subpop":"skunk","start":16,"end":17,"value":30},{"subpop":"skunk","start":17,"end":18,"value":10},{"subpop":"skunk","start":18,"end":19,"value":30},{"subpop":"skunk","start":19,"end":20,"value":30},{"subpop":"berry","start":0,"end":1,"v