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
View gist:2cefcc96d408a78a880dc3a489b998cb
{
"folders":
[
{
"path": ".",
}
],
"settings": {
"project_syntaxes": [
{
@bcomnes
bcomnes / .screenrc
Last active Aug 31, 2021
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
@bcomnes
bcomnes / git-gpg.md
Last active Aug 23, 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 / monty-hall.js
Created May 14, 2021
a monty-hall solution
View monty-hall.js
// Generate a random integer r with equal chance in min <= r < max.
function randomInt(min, max) {
var range = max - min;
if (range <= 0) {
throw new Exception('max must be larger than min');
}
var requestBytes = Math.ceil(Math.log2(range) / 8);
if (!requestBytes) { // No randomness required
return min;
}
View index.js
// https://ballpit.github.io/website/pics.zip
const fs = require('fs')
const get = require('simple-get')
const pump = require('pump')
const path = require('path')
get('https://ballpit.github.io/website/pics.zip', (err, res) => {
if (err) throw err
@bcomnes
bcomnes / late-2016-reading.md
Last active Apr 17, 2021
Late 2016 Reading list
View late-2016-reading.md
@bcomnes
bcomnes / ansible-examples.yml
Last active Mar 2, 2021
Ansible Yaml Syntax Exampls
View ansible-examples.yml
---
# Thanks halberom!
# http://blog.halberom.co.uk/ansible_yaml_syntax.html
- hosts: foo
tasks:
- name: single line plain style
file: path=/tmp/foo state=touch
- name: multi line plain style
file: path=/tmp/foo
View safe-url.js
export class SafeURL extends URL {
constructor(url, base) {
super(
url.replace(/^(http(s?):\/\/)?/, 'http$2://'),
base
);
}
}