Skip to content

Instantly share code, notes, and snippets.

View jackscott's full-sized avatar

Jack Tastic jackscott

View GitHub Profile
@jackscott
jackscott / rspec_model_testing_template.rb
Last active August 26, 2015 15:43 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@jackscott
jackscott / tuning_storm_trident.asciidoc
Last active August 25, 2015 20:30 — forked from mrflip/tuning_storm_trident.asciidoc
Notes on Storm+Trident tuning

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@jackscott
jackscott / spabs.md
Last active August 29, 2015 14:23 — forked from eevee/spabs.md

Death to tabs, long live spaces

Do this

  1. Fix any inconsistent indentation in your existing files, or Python code will break, since it considers a tab to be 8 and we're about to make it 4.

  2. Populate .gitattributes in your repository, as below.

     *.py filter=spabs
    
@jackscott
jackscott / introrx.md
Last active August 29, 2015 14:07 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@jackscott
jackscott / send_sns.py
Created March 29, 2014 19:13
CLI script to send messages via Amazon's SNS
#!/usr/bin/which python
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright © 2014 Jack Scott <code@nine78.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# mycharts.py
import sys
from reportlab.graphics.shapes import Drawing, String
from reportlab.graphics.charts import barcharts, piecharts, linecharts, legends
from reportlab.graphics.widgets.markers import makeMarker
from reportlab.graphics.charts.textlabels import Label
from reportlab.lib import colors
from reportlab.graphics.charts.piecharts import Pie, Pie3d
import types
@jackscott
jackscott / update_really_old_gentoo
Created May 15, 2013 21:12
Not sure if this still works or not, but got me out of a jam once upon a time...
###
# This was lifted from here: http://blog.jolexa.net/2009/03/gentoo-tips-to-upgrade-your-really-old-installation/
###
#Version 0, written by Nick Fortino
#March 23, 2009
#This has been tested only in chroot, bringing 2006.1-amd64-stage3 upto
#a stable amd64 system
#This is an experimental guide on how to upgrade an old system to get to