Skip to content

Instantly share code, notes, and snippets.

💭
I've got fun Gists, too.

Damion Armentrout darmentrout

💭
I've got fun Gists, too.
Block or report user

Report or block darmentrout

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@darmentrout
darmentrout / boxes.html
Created Jan 9, 2020
Fill a viewport with colorful boxes.
View boxes.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Boxes</title>
<style>
:root {
--box-w: 10vw;
@darmentrout
darmentrout / crt-text.html
Last active Jan 8, 2020
an imitation of CRT RGB pixels
View crt-text.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CRT TEXT</title>
<meta name="inspiration" content="https://i.redd.it/cgcpgwpa60841.jpg">
<style>
* { box-sizing: border-box; }
View abv-calculator.py
# -*- coding: utf-8 -*-
# ABV 1.0 12/31/2012
# This is one of my very first side projects as a programmer/developer!
print '''
Calculate the Alcohol by Volume (ABV) of your
homebrewed beer using the following formula:
ABV = ((((OG-FG)*1.05)/FG)/0.79)*100
1.05 gthe amount of CO2 per gram of ethanol produced
0.79 g/mLthe density of ethanol alcohol
@darmentrout
darmentrout / always-updated.html
Created Apr 12, 2019
A way of including .CSS and .JS files so that users always get the most current version. Bustin' caches makes me feel good.
View always-updated.html
<!-- put this in the HEAD -->
<script>
var newestVersion = Date.now();
var linkSrc = 'style.css?version=' + newestVersion;
var theLink = document.createElement("link");
theLink.href = linkSrc;
theLink.rel = 'stylesheet';
document.head.appendChild(theLink);
</script>
@darmentrout
darmentrout / dishwalla.js
Last active Apr 3, 2019
This is a stupid joke based on a song from 1996.
View dishwalla.js
var cars = {
"acura": {
"color": "blue",
"year": 2009
},
"buick": {
"color": "gray",
"year": 2010
},
"chevy": {
@darmentrout
darmentrout / user-theme-example.html
Created Aug 13, 2018
Setting custom themes for users with the HSL color model, CSS custom properties, and JavaScript Cookies.
View user-theme-example.html
<!DOCTYPE html>
<html lang="en" data-theme="green">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CSS Custom Properties Test</title>
<!-- Assembled by Damion Armentrout, 2018. -->
<style>
/* HSL is cool. https://www.sarasoueidan.com/blog/hex-rgb-to-hsl/ */
@darmentrout
darmentrout / generatePassword.php
Last active Jun 27, 2018 — forked from zyphlar/generatePassword.php
Generating secure passwords in PHP
View generatePassword.php
<?php
// usage: $newpassword = generatePassword(12); // for a 12-char password, upper/lower/numbers.
// functions that use rand() or mt_rand() are not secure according to the PHP manual.
function getRandomBytes( $nbBytes = 32 ){
$bytes = openssl_random_pseudo_bytes( $nbBytes, $strong );
if ( false !== $bytes && true === $strong ) {
return $bytes;
}
You can’t perform that action at this time.