Skip to content

Instantly share code, notes, and snippets.

@hagb4rd
hagb4rd / how-many-steps-does-it-take-to-get-from-me-to-you.markdown
Last active May 16, 2020 08:47
How Many Steps Does It Take To Get From Me To You?

How Many Steps Does It Take To Get From Me To You?

Color Interpolation! Yay! More adventures with colors and math! And Vue.js, of course. This is a bit less fun on Safari since it doesn't support input[type=color]. What's up with that, Apple?

Inspired by this pen

A Pen by hagb4rd on CodePen.

License.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<script src="script.js"></script>
@hagb4rd
hagb4rd / index.html
Created January 12, 2019 04:30
canvas dwitter background animation - https://hypnotic-hip.glitch.me
<!DOCTYPE html>
<head>
<link id="favicon" rel="icon" href="https://glitch.com/edit/favicon-app.ico" type="image/x-icon">
<meta charset="utf-8">
<link rel="stylesheet" href="/style.css">
<style>
:root {
background: black;
overflow: hidden;
@hagb4rd
hagb4rd / code.cpp
Created January 7, 2019 18:03 — forked from d7samurai/.readme.md
minimal d3d11 by d7samurai
// minimal d3d11 reference implementation; an uncluttered direct3d 11 setup and rendering primer for newcomers to the api.
// complete, runnable c+ application contained in a single function (winmain) and laid out in a step-by-step fashion that
// should be easy to follow from the code alone. win7 compatible. produces this output: https://youtu.be/XR7zPheek2Q
#pragma comment(lib, "d3d11")
#pragma comment(lib, "d3dcompiler")
#include <windows.h>
#include <d3d11_1.h>
@hagb4rd
hagb4rd / hyperhtml-component-for-data.markdown
Created December 26, 2018 20:46
hyperHTML Component.for(data)
@hagb4rd
hagb4rd / self-signed.md
Last active December 21, 2018 23:55
Creating a self-signed certificate using the OpenSSL command-line interface

USING A SELF SIGNED CERTIFICATE

The TLS/SSL is a public/private key infrastructure (PKI). For most common cases, each client and server must have a private key.

Private keys can be generated in multiple ways. The example below illustrates use of the OpenSSL command-line interface to generate a 4096-bit RSA private key:

openssl genrsa -out agamemnus-key.pem 4096
@hagb4rd
hagb4rd / index.html
Last active November 22, 2018 22:34
upload-image-to-imgur
<html>
<head>
<title>bit.ly/gistapp-image-upload</title>
<meta name="author" content="hagb4rd@gmail.com"></meta>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://unpkg.com/ea-webkit@latest/dist/webkit.min.js"></script>
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
// simple EventEmitter
// --> https://jsfiddle.net/7kj4L3gx/
var EventEmitter = function () {
this.listeners = {};
};
EventEmitter.prototype.listeners = null;
EventEmitter.prototype.addEventListener = function(type, callback) {
if (!(type in this.listeners)) {
this.listeners[type] = [];
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<meta name="viewport" content="width=device-width">
<title>pixel grid</title>
<style id="jsbin-css">
body {
background: #101010;
@hagb4rd
hagb4rd / sample.csv
Created November 10, 2018 21:03
csv data sample
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 12 columns, instead of 2. in line 9.
street,city,zip,state,beds,baths,sq__ft,type,sale_date,price,latitude,longitude
3526 HIGH ST,SACRAMENTO,95838,CA,2,1,836,Residential,Wed May 21 00:00:00 EDT 2008,59222,38.631913,-121.434879
51 OMAHA CT,SACRAMENTO,95823,CA,3,1,1167,Residential,Wed May 21 00:00:00 EDT 2008,68212,38.478902,-121.431028
2796 BRANCH ST,SACRAMENTO,95815,CA,2,1,796,Residential,Wed May 21 00:00:00 EDT 2008,68880,38.618305,-121.443839
2805 JANETTE WAY,SACRAMENTO,95815,CA,2,1,852,Residential,Wed May 21 00:00:00 EDT 2008,69307,38.616835,-121.439146
6001 MCMAHON DR,SACRAMENTO,95824,CA,2,1,797,Residential,Wed May 21 00:00:00 EDT 2008,81900,38.51947,-121.435768
5828 PEPPERMILL CT,SACRAMENTO,95841,CA,3,1,1122,Condo,Wed May 21 00:00:00 EDT 2008,89921,38.662595,-121.327813
6048 OGDEN NASH WAY,SACRAMENTO,95842,CA,3,2,1104,Residential,Wed May 21 00:00:00 EDT 2008,90895,38.681659,-121.351705
2561 19TH AVE,SACRAMENTO,95820,CA,3,1,1177,Residential,Wed May 21 00:00:00 EDT 2008,91002,38.535092,-121.481367
11150 TRINITY RIVER DR Unit 114,RANCHO CORDOV