Skip to content

Instantly share code, notes, and snippets.

View andrewgremlich's full-sized avatar
🐧
Solving problems with code!

Andrew Gremlich andrewgremlich

🐧
Solving problems with code!
View GitHub Profile
@andrewgremlich
andrewgremlich / readstream_no_boundary.js
Created April 26, 2022 17:24
The Phonebook (JS style)
const fs = require("fs");
const contactsReadStream = fs.createReadStream("./contacts.txt", {
encoding: "utf8",
});
contactsReadStream.on("data", (data) => {
const phonebook = {};
let output = "";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
:root {
--smile-stroke-width: 8px;
@andrewgremlich
andrewgremlich / AdvancedSearchModal.js
Created November 7, 2018 22:29
Advanced Search Modal for detailed data
class AdvancedSearchModalStyles {
constructor() {
this.themeLightGreen = '#4ff7a8';
this.themeGreen = '#42ce8d';
this.themeDarkGreen = '#309b69';
this.modalItemStyles = {
input: modalContent =>
(modalContent.style.cssText = this.inputComponentStyle`border: 1px solid ${
this.themeDarkGreen
}; cursor: pointer; display: inline;`),
@andrewgremlich
andrewgremlich / DetailedDropDown.js
Last active November 6, 2018 18:20
Detailed Dropdown. When some dropdowns aren't just enough, here's a detailed component dropdown for those dropdown needs
class DetailedDropDownStyles {
constructor() {
this.themeRed = '#ef4545';
this.themeRedBorder = '#c13636';
}
setStyles() {
this.searchBar.style.cssText = `
padding: 10px;
font-size: 20px;
const backgroundGradient = (() => {
let grad = document.querySelector('body'),
degree = 0,
red = 200,
green = 0,
blue = 100,
redup = true,
greenup = false,
blueup = false;
@andrewgremlich
andrewgremlich / phoneNumberValidation.js
Created June 15, 2018 21:09
This is a file that shows a formatted phone number based upon certain regular expressions to target certain areas.
let initMessageAids = (divOutput) => {
let style = `
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
@andrewgremlich
andrewgremlich / functionCall.js
Created April 23, 2018 18:23
Inheritance attempt with parent and grandparent with prototypes and objects.
function superb(a, b) {
this.a = a
this.b = b
}
superb.prototype.math = function() {
return this.a + this.b
}
function duper(c, d) {
@andrewgremlich
andrewgremlich / clientSideRouting.html
Last active April 19, 2018 02:27
A close implementation of client-side routing
<html>
<head>
<style media="screen">
nav p {
background-color: #c1c1c1;
cursor: pointer;
}
.output {
display: none;
}
@andrewgremlich
andrewgremlich / Contract Killer 3.md
Last active July 1, 2017 00:55
The latest version of my ‘killer contract’ for web designers and developers

Contract

Between [company name]

And [customer name].

Summary:

I’ll always do my best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I’ve no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

@andrewgremlich
andrewgremlich / menu-drawer.
Created March 3, 2017 22:53
Utilizes Web Components to make an menu-drawer for mobile devices. Primarily to be used with Progressive Web Apps.
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hamburger Menu</title>
<style>
* {