Skip to content

Instantly share code, notes, and snippets.

@hopeseekr
hopeseekr / conditional.js
Created June 25, 2021 03:19
Conditionally load non-minified JS if needed.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/our.min.js"></script>
<!-- Conditionally load the non-minified JS if needed -->
<script>
(function() {
if (typeof SOME_VAR === 'undefined') {
document.write('<script src="js/our.js"><\/script>');
}
@hopeseekr
hopeseekr / part1.md
Last active December 27, 2020 09:30
The Ether and The DAO: A cryptocoin Sci-FI short-story

The Inspiration

You know, I want to write a scifi story now about how aliens make #FirstContact with us, despite our aggression and disunity...

They choose to land at an #Ethereum conference in 2023 and say, “We want to welcome you to export consensus algorithm DAOs to the #GalacticFederation!”


The Backdrop

@hopeseekr
hopeseekr / grab-document.sh
Created October 22, 2020 16:11
Grab the text from an existing file -or- user input in BASH
#!/bin/bash
#############################################################
# Grab the text from an existing file -or- user input... #
# #
# Copyright © 2020 Theodore R. Smith #
# License: Creative Commons Attribution v4.0 International #
# From: https://github.com/hopeseekr/BashScripts/ #
# @see https://stackoverflow.com/a/64486155/430062 #
#############################################################
function grabDocument()
@hopeseekr
hopeseekr / youtube-duration-sorter.js
Last active September 21, 2020 13:13
Sort YouTube Videos by Duration, Descending
# Sorts YouTube duration, descending, in the Videos Tab
# Add as a bookmarklet
# See https://mreidsma.github.io/bookmarklets/installing.html (https://archive.is/zTp0O)
# Demo: ![image](https://user-images.githubusercontent.com/1125541/93770778-49596f00-fbe2-11ea-8095-9feee6ba6753.png)
javascript:(function(){l=[].map.call(document.querySelectorAll("span.ytd-thumbnail-overlay-time-status-renderer"),function(e){l=e.innerHTML.trim().split(":").map(function(t){return parseInt(t)}).reduce(function(p,c){return p*60+c});return{a:e.parentElement.parentElement.parentElement,l:l}}).sort(function(a,b){return b.l-a.l});i=document.querySelector("#primary #items");l.forEach(function(o){i.appendChild(o.a.parentElement.parentElement.parentElement)})})()
@hopeseekr
hopeseekr / amazing-aliases.sh
Last active April 8, 2025 18:32
Amazing Linux, PHP and Git aliases
# Dev aliases
alias free="free -m"
alias dup='(docker-compose up -d && docker-compose logs -ft)'
# I recomment putting this in /etc/cron.daily/
alias docker-prune='docker rmi $(docker images | grep "^<none>" | awk "{print $3}")'
# Git
alias gd='git diff'
alias ga='git add'
alias gco='git checkout --ours'
@hopeseekr
hopeseekr / Cookie Clicker Save.md
Created September 1, 2020 21:31
Cookie Clicker Save
@hopeseekr
hopeseekr / stop_sequencer.php
Created May 3, 2020 20:25
Splits long DNA strings into sequences and then counts the stop codons.
<?php
$DNA = file($argv[1]);
$splitDNA = str_split($DNA[1], 3);
$stopCodons = [
'TAG',
'TAA',
'TGA',
@hopeseekr
hopeseekr / index.html
Created March 11, 2020 15:41 — forked from tiffany352/index.html
Twitter archive browser
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Twitter Archive Browser</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
<style>
@hopeseekr
hopeseekr / phones.js
Created October 3, 2019 00:48
Formatting phones
phone: {
get: function() {
return this.value;
},
// setter
set: function(newValue) {
if (newValue.length === 1) {
this.value = "(" + newValue;
} else if (newValue.length === 4) {
this.value = newValue + ") ";