Skip to content

Instantly share code, notes, and snippets.

View audstanley's full-sized avatar
📡
Send me a message on aprs: KM6LZF

Richard Stanley audstanley

📡
Send me a message on aprs: KM6LZF
View GitHub Profile
/* Gregory Pierot */
* {
box-sizing: border-box;
}
input {
display: inline-block;
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid #c2c8d9;
color: #444444;
<!-- Gregory Pierot -->
<template name="chat">
{{> mainTitle}}
{{> navbar }}
{{#if currentUser}}
<div class="messages-box">
<div class="messages-scroll">
<div class="header">
<h1>Welcome to Epicenter Chat!</h1>
@audstanley
audstanley / convertBytesToStringUpToTerribytes.js
Last active October 29, 2019 20:08
a function to take some bytes, and make it a string in JavaScript.
const convertBytesToStringUpToTerribytes = bytes => {
const lengthOfInt = Math.ceil(Math.log10(bytes + 1)); // Mathimatically get the length of an Integer.
if (lengthOfInt >= 1 && lengthOfInt <= 3) {
return `${bytes}bytes`;
} else if (lengthOfInt >= 4 && lengthOfInt <= 6) {
return `${(bytes / 1000).toPrecision(3)}Kb`;
} else if (lengthOfInt >= 7 && lengthOfInt <= 9) {
return `${(bytes / 1000000).toPrecision(3)}Mb`;
} else if (lengthOfInt >= 10 && lengthOfInt <= 12) {
return `${(bytes / 1000000000).toPrecision(3)}Tb`;
<!-- Erik -->
<template name="fileSearch">
{{> navbar }}
<!-- do work and your divs here -->
{{> displayFiles}}
</template>
<template name="displayFiles">
{{#with allFiles }}
{{#each allFiles }}
// Erik
import { Template } from "meteor/templating";
import { ReactiveVar } from "meteor/reactive-var";
import { Files } from "../imports/api/Files";
Template.displayFiles.helpers({
allFiles() {
let allFilesFromMongo = Files.find().fetch();
let allFilesFromMongoReversed = allFilesFromMongo.reverse();
let allFilesWithSizeString = allFilesFromMongoReversed.map(fileObj => {
@audstanley
audstanley / header.php
Last active April 17, 2020 03:09
Nick's studio-folio Javascript to make things fnacy :-)
<?php
global $data;
$classmenu = (isset($data['inline_menu']) && $data['inline_menu'] && !$data['left_menu']) ? ' inline_menu' : ' newline_menu';
$blog_title = get_bloginfo('name');
/* if (LOGO_IMG) $logo = "<img src='".LOGO_IMG."' alt='' title='' />"; */
/* if (LOGO_IMG) $logo = "<embed src='http://nickwenger.com/images/WEBLOGO_8.svg height='70'><embed>"; */ //old size
if (LOGO_IMG) $logo = "<div><embed id='Nicks-Logo-Thanks-To-Richard-Stanley' src='http://nickwenger.com/images/WEBLOGO_8.svg' height=70 style='width: auto;' ><embed></div>";
else $logo = get_bloginfo('name');
# article/sqliteArticles.py
# lines 76 - 81:
if "byId" in kwargs and kwargs["byId"]:
sql = ( str(kwargs["article_id"]), )
for row in cur.execute("SELECT * FROM articles WHERE articles_id = ?", sql):
data = dict(zip(expectedSqlResults, row))
rows.append(data)
return rows
@audstanley
audstanley / setup.py
Last active April 8, 2019 01:16
for web Backend Class project
import os
import sys
from setuptools import setup
from subprocess import PIPE, Popen
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
def NginxDefaultConfigFile():
try:
#!/usr/bin/python3.6
from threading import Thread
from functools import wraps
import sys
from subprocess import Popen, PIPE
from difflib import SequenceMatcher
from time import sleep
import re
import rstr
@audstanley
audstanley / main.go
Last active November 14, 2018 20:46
This will remove comments and unwanted string lengths
package main
import (
"fmt"
"regexp"
)
func main() {
theString := ` program a2018;
/* This comment