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 / .vimrc
Last active August 29, 2015 14:07
my vimrc with
" ===== vim-go - github.com/fatih/vim-go =====
" goimports
let g:gofmt_command ="goimports"
" gofmt on save
autocmd FileType go autocmd BufWritePre <buffer> Fmt
" useful maps
au FileType go nmap <leader>r <Plug>(go-run)
@mmcdaris
mmcdaris / cat_map.go
Last active August 29, 2015 14:11
Map Literals Continued
package main
import "fmt"
type Cat struct {
size, snack string
}
var cats = map[string]Cat{
"bello": {"med-small", "Bonito Flakes"},
@mmcdaris
mmcdaris / scoreboard.sh
Created February 5, 2015 17:58
Simple Redis ScoreBoard with a sorted set
127.0.0.1:6379> ZADD FEB-SCORES 0 "JP"
(integer) 1
127.0.0.1:6379> ZADD FEB-SCORES 0 "MORGAN"
(integer) 1
127.0.0.1:6379> ZINCRBY FEB-SCORES 10 "MORGAN"
"10"
127.0.0.1:6379> ZINCRBY FEB-SCORES 20 "JP"
"20"
127.0.0.1:6379> ZREVRANGE FEB-SCORES 0 -1 WITHSCORES
1) "JP"
@mmcdaris
mmcdaris / post-commit
Last active March 24, 2016 16:23
rescuetime daily habits post-commit hook
#!/bin/sh
# more info on set -e https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html#The-Set-Builtin
set -e
## CREDIT
# I made this from: https://github.com/RescueTime/git-commits-to-rescuetime-daily-highlights/blob/master/post-commit.sample
# Thanks @robby1066 it's been fun fine tuning this
## INSTALLATION
# add this to any project's .git/hooks/ dir as post-commit
# chmod -x .git/hooks/post-commit
@mmcdaris
mmcdaris / dynamic-redis-geo.md
Created February 27, 2015 06:30
dynamic-redis + redis-geo setup
@mmcdaris
mmcdaris / meditation.md
Last active August 29, 2015 14:23
Meditation kit

How meditation can reshape our brains

IMAGE ALT TEXT

How to meditate

IMAGE ALT TEXT

@mmcdaris
mmcdaris / README.md
Last active August 29, 2015 14:27
airbrake-js filter: Don't send project root in backtrace lines

I was playing with the airbrake-js requirejs example and trying to filter out project_root from backtrace lines

Here is my airbrake-js addFilter for filtering out project root

airbrake.addFilter(function(notice) {
  var projectRoot = 'PROJECT_ROOT';
  for (i = 0; i < notice.errors.length; i++) {
    for(j = 0; j < notice.errors[i].backtrace.length; j++) {
      notice.errors[i].backtrace[j].file = notice.errors[i].backtrace[j].file.replace(projectRoot, '')
 };
@mmcdaris
mmcdaris / airbrake-django.md
Last active August 29, 2015 14:27
airbarke-django example

Install airbrake-django from github using pip

pip install git+https://github.com/airbrake/airbrake-django.git

Add airbrake to your settings.py

Make a section in your settings.py for the airbrake settings for your project: