Skip to content

Instantly share code, notes, and snippets.

@mmcdaris
mmcdaris / airbrake_v3.md
Last active August 29, 2015 14:06
Some possibly useful endoints

getting your auth_token:
go to https://YOUR-SUBDOMAIN.airbrake.io/users
click you and your user and
your auth_token will be near the bottom of the page

https://airbrake.io/api/v3/projects/<ID>/groups/<ID>?key=<AUTH_TOKEN>

Here is an example group:

{
@mmcdaris
mmcdaris / about.md
Last active August 29, 2015 14:05
Simulate some exceptions with json and curl! you need your project id and api key

Setup

  1. save both files locally
  2. make simulate.sh executable
chmod +x simulate.sh

Usage

The first argument is intended to be a json file valid against the json schema for an error

Command
@mmcdaris
mmcdaris / stuffed_jalapenos.md
Last active August 29, 2015 14:03
Morgan's Dad's Bacon Wrapped Stuffed Jalapeño recipe!

#####Tools:

  • spoon
  • toothpicks
  • bbq/smoker/oven

#####Ingredients:

  • Jalapeño
  • Bacon
@mmcdaris
mmcdaris / github_issues.rb
Created July 8, 2014 01:23
get your issues on!
require 'octokit'
class Github
attr_accessor :cli, :user, :gh_user
def initialize(user)
@gh_user = user
@cli = Octokit::Client.new(access_token: ENV["GH_KEY"])
@user = @cli.user
@user.login
end
@mmcdaris
mmcdaris / signals.go
Created May 12, 2014 20:30
handles signals, don't send -9 ;P
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@mmcdaris
mmcdaris / go_build_man.md
Last active October 3, 2024 16:17
going through the go build command

usage

go build: compiles the packages named by the import paths, along with their dependencies, the binary does not end up in $GOPATH/bin it gets created in the dirs

go build [-o output] [build flags] [packages]

If the [packages] are a list of .go files, build treats them as a list of source files specifying a single package.

@mmcdaris
mmcdaris / slices.go
Last active August 29, 2015 14:00
used gobyexample and the go article on slices: http://blog.golang.org/go-slices-usage-and-internals
package main
import "fmt"
func main() {
slicesOne()
makeSlice()
slicesTwo()
sliceInternals()
}
@mmcdaris
mmcdaris / airbrake_ignore.rb
Last active August 29, 2015 13:57
airbrake ignore experiments
# Returns an exception of your choice
# = Usage
# route_error = exception_of_type(ActionController::RoutingError)
# url_error = exception_of_type(ActionController::UrlGenerationError)
def exception_of_type(type, args = nil)
type.new StandardError.new(args)
end
# Gets an Airbrake::Notice object for the exception
# = Usage
@mmcdaris
mmcdaris / cows.md
Last active August 29, 2015 13:56
There can be one or many cows! how can you make them all eat their dinner?

cow_eating

@mmcdaris
mmcdaris / watchfiles.go
Created February 25, 2014 10:15
restart an upstart script when there is an inotify event
// this is almost complete :)
// name: watchfiles.go
// purpose: emit a restart
package main
import (
"log" // printing
"code.google.com/p/go.exp/inotify" // inotify events
"os" // argument handling
"os/exec" // used to call initctl restart process name