Skip to content

Instantly share code, notes, and snippets.

View bergerjac's full-sized avatar

Jake Berger bergerjac

View GitHub Profile
@bergerjac
bergerjac / features--support--env.rb
Last active August 29, 2015 14:15
rspec, cucumber, FactoryGirl
# include RSpec Factories in Cucumber
Dir["../../spec/factories/*.rb"].each { |file| require_relative file }
@bergerjac
bergerjac / capybara_cheat_sheet.rb
Last active August 29, 2015 14:15 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
# debugging
save_and_open_page
puts page.body
puts find("#id").native
puts first("#id .class element").native
# navigating
visit('/projects')
visit(post_comments_path(post))

Keybase proof

I hereby claim:

  • I am bergerjac on github.
  • I am jacobberger (https://keybase.io/jacobberger) on keybase.
  • I have a public key whose fingerprint is 40E9 6B86 8C85 4ABF 710E 509E 4A89 D5CF D7C7 4196

To claim this, I am signing this object:

@bergerjac
bergerjac / Node.js Express Async Error Handler.js
Last active August 29, 2015 14:02
Node.js Express Async Error Handler
/* refs
http://machadogj.com/2013/4/error-handling-in-nodejs.html
http://nodejs.org/api/process.html#process_event_uncaughtexception
*/
function asyncTryCatch(tryFunction, catchFunction, keepAliveOnHandled)
{
process.on('uncaughtException', function(ex)
{// hook onto uncaughtException -> execute catch
var handled = catchFunction(ex);
@bergerjac
bergerjac / Application.cs
Created April 5, 2012 00:51
LightSwitch Custom Logo
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace LightSwitchApplication
{
public partial class Application
@bergerjac
bergerjac / ControlHelpers.cs
Created March 18, 2012 16:23
LightSwitch: Strong Type FindControl
// Client
using System;
using System.Diagnostics;
using System.Windows.Controls;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;
namespace LightSwitchApplication
{