Skip to content

Instantly share code, notes, and snippets.

View damilolaolatunji's full-sized avatar
🏠
Working from home

damilolaolatunji

🏠
Working from home
View GitHub Profile
@damilolaolatunji
damilolaolatunji / logger.go
Created August 12, 2022 12:02
Extending the Go log package with log levels
// Adapted from https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/13.4.html
package logger
import (
"log"
"os"
)
const (
LevelTrace = iota
@damilolaolatunji
damilolaolatunji / style.css
Last active August 3, 2023 09:33
Stylesheet for Hacker News App
html {
box-sizing: border-box;
}
*, *::before, *::after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
const hexValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
const button = document.querySelector('.btn');
const body = document.querySelector('body');
const value = document.querySelector('.hexValue');
function changeHex() {
let hex = '#';
for (let i = 0; i < 6; i++) {
const index = Math.floor(Math.random() * hexValues.length);
html {
box-sizing: border-box;
}
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: inherit;
}
<!DOCTYPE html>
<html>
<head>
<title>Hex colour generator</title>
<link rel="stylesheet" href="/assets/css/style.css" />
</head>
<body>
<div class="container">
<h1>Hex Color Code: <span class="hexValue">#ffffff</span></h1>
<button class="btn">Click me</button>