Skip to content

Instantly share code, notes, and snippets.

View evadnoob's full-sized avatar

David Boon evadnoob

  • Auth0
  • Seattle, WA
View GitHub Profile
@evadnoob
evadnoob / pre-commit.sh
Created August 2, 2017 15:42 — forked from czardoz/pre-commit.sh
Git pre-commit hook that checks for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi
This file has been truncated, but you can view the full file.
Step 1/7 : FROM golang:1.7-alpine
---> 00371bbb49d5
Step 2/7 : ENV GODEBUG netdns=cgo+1
---> Using cache
---> f143f22f2b7f
Step 3/7 : RUN apk --no-cache add --update bash openssl
---> Using cache
---> 6841f4012d1c
Step 4/7 : WORKDIR /
This file has been truncated, but you can view the full file.
Step 1/7 : FROM golang:1.7-alpine
---> 00371bbb49d5
Step 2/7 : ENV GODEBUG netdns=cgo+1
---> Using cache
---> f143f22f2b7f
Step 3/7 : RUN apk --no-cache add --update bash openssl
---> Using cache
---> 6841f4012d1c
Step 4/7 : WORKDIR /

project approach

create type map asset depends on user etc

create code to render entities as json objects for export(getPartial/exportp1 and get/exportp2)

ideas for how this could be made easier to implement

  1. use an ORM describe the entities as structs (saves time with boilerplate tedius column)
@evadnoob
evadnoob / The Technical Interview Cheat Sheet.md
Created July 9, 2016 14:16 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
curl -sL https://omnitruck.chef.io/install.sh | sudo bash -s -- -P "chef" -c "current" -v "12.10.40"
debian 8 x86_64
Getting information for chef current 12.10.40 for debian...
downloading https://omnitruck.chef.io/current/chef/metadata?v=12.10.40&p=debian&pv=8&m=x86_64
to file /tmp/install.sh.17360/metadata.txt
trying wget...
ERROR 404
Omnitruck artifact does not exist for version 12.10.40 on platform debian
Either this means:
@evadnoob
evadnoob / colortrans.py
Created November 25, 2015 21:09 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
#!/usr/bin/env ruby
#
require 'json'
require "docopt"
doc = <<DOCOPT
Hipchat cli
Usage:
#{__FILE__} --auth-token=<auth_token> notify [--type=<type>] [--state=<state>] --room=<room> <message> [--dry-run]
static CHARS: &'static str = "0123456789ABCDEFGHIJKLMNPRSTUVWYXZ_abcdefghijkmnopqrstuvwyxz";
fn base60_encode(num: i64) -> String {
let mut hash = String::new();
let mut n = num;
while n > 0 {
let remainder = n % 60;
hash.push(CHARS.chars().nth(remainder as usize).expect("expected a character!"));
Compiling sorting-algorithms v0.1.0 (file:///home/david/projects/sorting-algorithms)
Running target/debug/sorting_algorithms-abc13d1b10871a26
running 1 test
selection sort
unsorted [1, 88, 4, 9, 3, 2, 15, 12, 6, 7]
unsorted [1, 2, 3, 4, 6, 7, 9, 12, 15, 88]
test it_works ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured