Skip to content

Instantly share code, notes, and snippets.

View mickelsonm's full-sized avatar

Matt Mickelson mickelsonm

  • USA
View GitHub Profile
@mickelsonm
mickelsonm / pictime.sh
Created July 8, 2016 04:05
Implementation using imagesnap in a photoshoot kind of way...
#!/bin/bash
while true
do
imagesnap -w 2 pic$RANDOM.jpg
sleep 1
done
@mickelsonm
mickelsonm / regexp.md
Created April 30, 2016 06:48
Miscellaneous from Regex talk
  • cks command (exact matches)
  • matching characters (example: o.)
  • alternate character classes (example: b[eor]at)
  • negated character classes (example: b[^eo]at)
  • ranges (example: [1-9], [A-Za-z])
  • anchors (example: ^Hmm, Hmm$)
  • repetition (example: So*me , o{2,})
  • named capture
  • replacements (ex. ^Ms.(.|))
  • \d is the same as 0-9 (integral....probably from sprintf?)

How to Mentor Jr. Devs without losing your mind

  • should not be a senior dev only shop... Expensive, high burnout, less challenging
  • mentoring takes time and is frustrating...it's an investment
  • check your ego at the door
  • encourage confidence, not cockiness
  • ask: how can I be helpful?
  • Suzuki method...create the environment
  • patience, empathy, be available and active, willing to have hard conversations...tell me or I don't know
  • enforce 20-30 minute I am stuck rule. Put the ego aside and help.
@mickelsonm
mickelsonm / active-states-counties-json.go
Last active February 15, 2016 07:51
A Go program that does data scraping on a website for states and their counties.
package main
import (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"
"github.com/PuerkitoBio/goquery"
@mickelsonm
mickelsonm / slice-distribution.go
Created February 6, 2016 02:37
Go Slice Distribution Example
package main
import "fmt"
// Divides `slice` into `n` subslices such that the elements are distributed
// as evenly as possible. In other words, if there are 10 elements in `slice`,
// and `n` is 3, there will be one subslice with 4 elements and the others will
// have only 3.
func subslice(s []interface{}, n int)(ret [][]interface{}){
for ; n > 0; n-- {
var expiration = '0000-00-00 00:00:00';
if (body.expiration !== undefined) {
var arr = body.expiration;
//check to make sure it is an array
if (!Array.isArray(arr)) {
def.reject('expiration property is not a valid array');
return def.promise;
}
//check to make sure it is of the right length [d,h,m,s]
if (arr.length !== 4) {
@mickelsonm
mickelsonm / docker-present.md
Last active January 19, 2016 03:48
Docker for the Working Technologist Presentation

Docker for the Working Technologist

Container technologies, like Docker, are making their appearance in many technology shops across the globe. Come see some of my use cases for it and how “Dockerizing” things can be both fun and challenging. I am hoping that as a working technologist, you will find some use cases of your own and at the very least, it should provoke thought into how you are currently developing your tools or services within your own technology stacks.

Presentation given 11/16/2015

What's Docker?

https://www.docker.com/what-docker

@mickelsonm
mickelsonm / roulettesim.php
Created November 14, 2015 04:44
Roulette Simulator
<?php
class Table {
protected $bets = [];
protected $numbers = [
0 => ['color' => 'green'],
1 => ['color' => 'red'],
2 => ['color' => 'black'],
@mickelsonm
mickelsonm / crayola.json
Created November 2, 2015 21:50 — forked from jjdelc/crayola.json
Crayola colors in JSON format
[
{
"hex": "#EFDECD",
"name": "Almond",
"rgb": "(239, 222, 205)"
},
{
"hex": "#CD9575",
"name": "Antique Brass",
"rgb": "(205, 149, 117)"
@mickelsonm
mickelsonm / stringToSha1.go
Created October 31, 2015 06:20
Go - String to Sha1
package main
import (
"crypto/sha1"
"encoding/hex"
"fmt"
)
func main() {
for i := 0; i < 100; i++ {