Skip to content

Instantly share code, notes, and snippets.

View coryodaniel's full-sized avatar

Cory O'Daniel coryodaniel

View GitHub Profile
coryodaniel / .pre-commit-hooks.yaml
Last active July 9, 2022 22:43 — forked from athiththan11/pre-commit
Git Pre Commit Hook for FIXME TODO
- id: deny-todos
name: Denies TODOs or FIXME
description: 'Denies TODOs or FIXME in commits'
language: script
coryodaniel /
Created March 10, 2020 03:32 — forked from andyrbell/
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
coryodaniel / deployment.yml
Created February 1, 2019 02:04 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
name: mans-not-hot
app: mans-not-hot
replicas: 1
coryodaniel / Makefile
Created July 18, 2018 23:20 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
coryodaniel /
Created July 18, 2018 14:48 — forked from jadkik/
Used to validate nginx templated config files before actually using them. For use with Ansible.
#!/usr/bin/env bash
# Example usage from an Ansible playbook:
# - name: Copy the nginx validate script
# copy: dest=/opt/ mode=0744
# - name: Update main nginx config file
# template:
# src: nginx.conf.j2
# dest: /etc/nginx/nginx.conf
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path("$"))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
coryodaniel / es_index_maintenance.js
Created June 29, 2017 21:47 — forked from devoncrouse/es_index_maintenance.js
Elastic Search maintenance script for periodic indices. Manages optimization/write-protection/closure/removal of indices based on age (derived from index naming convention) and status.
#!/usr/bin/env node
// Configuration
var argv = require('optimist')
.usage('Usage: $0 --prefix index_prefix [options]')
host: 'Elastic Search host',
port: 'Elastic Search port',
secure: 'Use secure Elastic Search connection',
coryodaniel / labels.yaml
Last active June 9, 2017 23:55 — forked from omegahm/
Github Labels
repo: coryodaniel/my-repo-yo
#- name: ruby
# color: BFD4F2
- name: elixir
color: BFD4F2
- name: nodejs
color: BFD4F2
#- name: rails
coryodaniel / file.sql
Created October 17, 2016 01:06 — forked from emmanuel/file.sql
Closure Table operations SQL fragments
-- Retrieve descendants
-- ====================
-- retrieve descendants of #4
FROM Comments AS c
JOIN TreePaths AS t ON c.comment_id = t.descendant
WHERE t.ancestor = 4;
-- Retrieve ancestors