Skip to content

Instantly share code, notes, and snippets.

Avatar
🏜️
🚙🛸🌵🛰

Bret bcomnes

🏜️
🚙🛸🌵🛰
View GitHub Profile
@bcomnes
bcomnes / redshift.conf
Created Dec 9, 2012
My configuration file for Redshift. Place it in ~/.config/ Drag redshift onto the Startup Applications menu to have it boot on start
View redshift.conf
; 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
@bcomnes
bcomnes / git-gpg.md
Last active Jan 19, 2021
my version of gpg on the mac
View git-gpg.md
  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 / .screenrc
Last active Dec 24, 2020
ssh agent forwarding in tmux and gnu screen
View .screenrc
# 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
View safe-url.js
export class SafeURL extends URL {
constructor(url, base) {
super(
url.replace(/^(http(s?):\/\/)?/, 'http$2://'),
base
);
}
}
@bcomnes
bcomnes / bookmarks.sql
Last active Dec 14, 2020
bookmark pg schema v2
View bookmarks.sql
CREATE EXTENSION IF NOT EXISTS citext;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT uuid_generate_v1mc(),
username citext UNIQUE NOT NULL,
email citext UNIQUE NOT NULL,
email_confirmed BOOLEAN NOT NULL DEFAULT false,
password text
);
View bookmarking-schema.sql
CREATE EXTENSION citext;
CREATE DOMAIN email_address AS citext
CHECK (
value ~ '^[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$'
);
CREATE TABLE users (
id INT GENERATED ALWAYS AS IDENTITY primary key,
View package.json
{
"name": "react-16",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)",
"license": "MIT",
@bcomnes
bcomnes / late-2016-reading.md
Last active Jul 30, 2020
Late 2016 Reading list
View late-2016-reading.md
@bcomnes
bcomnes / os_diff.sh
Last active Mar 2, 2020
Run different sh scripts depending on system: http://stackoverflow.com/a/17072017/1287889
View os_diff.sh
#!/bin/bash
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under GNU/Linux platform
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
# Do something under Windows NT platform
fi