Skip to content

Instantly share code, notes, and snippets.

View bcomnes's full-sized avatar
👽

Bret Comnes bcomnes

👽
View GitHub Profile
@bcomnes
bcomnes / git-gpg.md
Last active February 13, 2024 07:33
my version of gpg on the mac
  1. brew install gnupg, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@bcomnes
bcomnes / redshift.conf
Created December 9, 2012 07:35
My configuration file for Redshift. Place it in ~/.config/ Drag redshift onto the Startup Applications menu to have it boot on start
; Global settings
[redshift]
temp-day=6500K
temp-night=5000
transition=1
;gamma=0.8:0.7:0.8
gamma=1.000:1.000:1.000
location-provider=geoclue
;location-provider=manual
adjustment-method=vidmode
<!DOCTYPE html>
<html lang="en-us" dir="ltr" itemscope itemtype="http://schema.org/Article">
<head>
<meta charset="utf-8">
<meta name="description" content="A resource for developers looking to put HTML5 to use today, including information on specific features and when to use them in your apps.">
<meta name="keywords" content="html5,html 5,html5 demos,html5 examples,javascript,css3,notifications,geolocation,web workers,apppcache,file api,filereader,indexeddb,offline,audio,video,drag and drop,chrome,sse,mobile">
<title>Yo Polymer – A Whirlwind Tour Of Web Component Tooling - HTML5Rocks Updates</title>
<script type='text/javascript'>window.mod_pagespeed_start = Number(new Date());</script><link rel="shortcut icon" href="http://www.html5rocks.com/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="HTML5Rocks RSS" href="http://feeds.feedburner.com/html5rocks"/>
<link rel="stylesheet" media="all" href="http://www.html5rocks.com/static/css/base.css">
@media (prefers-color-scheme: dark) {
#main a { color: #bfdfff; }
body { background-color: #292a2d; }
#main a:hover { background-color: #000000; }
#main a:hover { color: #80ecff; }
#main a:hover { box-shadow: 0 0 7px #0080ff; }
#main a:hover { box-shadow: 0 0 7px #0080ff; }
}
@bcomnes
bcomnes / static.js
Created October 10, 2022 15:50
Fastify static with private admin section
import fp from 'fastify-plugin'
import path from 'path'
import desm from 'desm'
const __dirname = desm(import.meta.url)
/**
* This plugins adds fastify-static
*
* @see https://github.com/fastify/fastify-static
@bcomnes
bcomnes / .screenrc
Last active August 21, 2022 10:33
ssh agent forwarding in tmux and gnu screen
# Fix agent forwarding
# https://gist.github.com/martijnvermaat/8070533
# http://techblog.appnexus.com/2011/managing-ssh-sockets-in-gnu-screen/
# See .ssh/rc for socket linking
unsetenv SSH_AUTH_SOCK
setenv SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock.$HOSTNAME
@bcomnes
bcomnes / Jenkinsfile
Created December 8, 2018 00:59
Git env vars you might need in jenkins
/*
Jenkins ENV Reference:
env.GIT_COMMIT: the commit sha of the current build
env.BRANCH_NAME: the branch name OR tag name of the current build, when it exists
env.GIT_BRANCH: same as BRANCH_NAME
env.TAG_NAME: the tag name of the current build, when it exists
*/
import fp from 'fastify-plugin'
import Fastify from 'fastify'
/**
* This plugins adds promethius metrics
*
* @see https://gitlab.com/m03geek/fastify-metrics
*/
export default fp(async function (fastify, opts) {
fastify.register(import('fastify-metrics'), {})
@bcomnes
bcomnes / errors.ts
Last active October 22, 2021 00:27
import { someAsyncTask } from 'a-library'
async function doSomething () {
try {
const results = await someAsyncTask();
const betterResults = results.map(stuff => { betterStuff: stuff });
return results;
} catch (error) {
if (error instanceof Error){
console.error(error.message)
@bcomnes
bcomnes / .bash_profile
Last active October 6, 2021 15:38
bashrc utopia
#
# ~/.bash_profile
#
# Do everything in bashrc
[[ -f ~/.bashrc ]] && . ~/.bashrc