Skip to content

Instantly share code, notes, and snippets.

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

danydodson danydodson

🏠
Working from home
View GitHub Profile
@danydodson
danydodson / web-servers.md
Last active November 15, 2022 05:54
web servers

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

python -m SimpleHTTPServer 8000
@danydodson
danydodson / header-logging.conf
Last active November 15, 2022 05:49
nginx header logs
# Load JavaScript code from here
js_include conf.d/header_logging.js;
# Fill variable from JS function
js_set $access_log_with_headers kvAccessLog;
# Define special log format
log_format kvpairs $access_log_with_headers;
server {
@danydodson
danydodson / cookie_signing.js
Last active November 15, 2022 05:48
nginx cookies
@danydodson
danydodson / useLocation.js
Last active November 15, 2022 05:54
react hooks
/**
* @info React hook that keeps up to date with the current location.
*/
import { useState, useEffect } from 'react'
function getCurrentLocation() {
return {
pathname: window.location.pathname,
search: window.location.search
@danydodson
danydodson / create_jwt.sh
Last active November 15, 2022 05:49
nginx jwt tools
#!/bin/bash
# create_jwt.sh (c) NGINX, Inc. [v0.3 10-Jul-2019] Liam Crilly <liam.crilly@nginx.com>
#
# This script accepts a JSON claimset (JWT payload) and creates produces a
# JOSE-signed token to stdout using one of the supported signature algorithms.
#
# CHANGELOG
# v0.1 Initial version (hs256 only)
# v0.2 Added support for various hs signature lengths
# v0.3 Checks for expired exp claims, option to specify exp duration
@danydodson
danydodson / readme-template.md
Last active November 15, 2022 05:55
template: readme

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@danydodson
danydodson / slide-show-template.md
Last active November 15, 2022 05:56
template: slide show
@danydodson
danydodson / programs.ipynb
Last active November 15, 2022 06:45
simple python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danydodson
danydodson / trig.scss
Last active November 15, 2022 05:50
sass calculations
// Plain SASS Trigonometry Algorithm in Taylor Expansion
$pi: 3.14159265359;
$_precision: 10;
@function pow($base, $exp) {
$value: $base;
@if $exp > 1 {
@for $i from 2 through $exp {
$value: $value * $base;
JavaScript 22 hrs 33 mins ███████▍░░░░░░░░░░░░░ 35.4%
Other 17 hrs 39 mins █████▊░░░░░░░░░░░░░░░ 27.7%
YAML 6 hrs 13 mins ██░░░░░░░░░░░░░░░░░░░ 9.8%
Lua 5 hrs 6 mins █▋░░░░░░░░░░░░░░░░░░░ 8.0%
Markdown 4 hrs 42 mins █▌░░░░░░░░░░░░░░░░░░░ 7.4%