Skip to content

Instantly share code, notes, and snippets.

describe('example', function() {
beforeEach(function(){
var scheduler = this.scheduler = new Rx.TestScheduler();
this.userEmails = this.scheduler.createHotObservable(
Rx.ReactiveTest.onNext(
210,
{email: 'bob@bob.com'}
),
@mikeauclair
mikeauclair / output.txt
Created January 4, 2017 22:36
Promise union type
± ./node_modules/.bin/flow check 039efe8|add_more_types*
test.js:18
18: getQQ().then(function(val){
^^^^ property `then`. Property not found in
18: getQQ().then(function(val){
^^^^^^^ Array
Found 1 error
require 'ruby-prof'
def profile_as(name)
if ENV['PROFILE']
RubyProf.start
yield
result = RubyProf.stop
@mikeauclair
mikeauclair / ProfilingGuide.md
Last active August 7, 2019 16:19
Profiling

Easy steps for CPU profiling a Rails app

  1. add ruby-prof to your gemfile (https://github.com/ruby-prof/ruby-prof)
  2. grab kcachegrind or qcachegrind (brew install qcachegrind graphviz on os x)
  3. plop development_profiler.rb in lib in your app
  4. wrap your questionable code in a prof block
  5. open the file in qcachegrind (It'll live in tmp/performance in your app)