Skip to content

Instantly share code, notes, and snippets.

View jrichardlai's full-sized avatar

Jean-Richard Lai jrichardlai

  • Guideline
  • San Francisco, CA
View GitHub Profile
@jrichardlai
jrichardlai / gist:1083597
Created July 14, 2011 22:13
Added onControlsClick to jquery.bxslider.js
// In showControls()
// click next control
$nextHtml.click(function() {
base.goToNextSlide();
options.onControlsClick(base);
return false;
});
// click prev control
$prevHtml.click(function() {
@jrichardlai
jrichardlai / not_route_to.rb
Created May 13, 2012 20:19
Spec Matcher for Rails and Rspec1 to ensure that a route does not route to a specific path
# Sometimes in your app you may have a global route that will catch everything
# So it's not possible to use should_not be_routable or should_not route_to
# In this case you can use should not_route_to.
# Example:
# {:get => '/users/123/upgrade'}.should not_route_to(:controller => "users", :action => "upgrade", :user_id => "123")
Spec::Matchers.define :not_route_to do |destination|
extend Spec::Rails::Example::RoutingHelpers
match_unless_raises do |path|
method, path, querystring = Spec::Rails::Matchers::PathDecomposer.decompose_path(path)
#!/bin/bash -x
find . -name 'fbjs' -print | grep "\./node_modules/fbjs" -v | xargs rm -rf
@jrichardlai
jrichardlai / ErrorManager.java
Last active February 7, 2018 20:44
Bugsnag integration with React Native
import android.util.Base64;
import android.util.Log;
import com.bugsnag.android.Bugsnag;
import com.bugsnag.android.MetaData;
import com.bugsnag.android.Severity;
import com.facebook.react.bridge.*;
import java.io.File;
import java.io.InputStream;