- use an ORM describe the entities as structs (saves time with boilerplate tedius column)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder