Skip to content

Instantly share code, notes, and snippets.

View JaisonBrooks's full-sized avatar

Jaison Brooks JaisonBrooks

  • Enphase Energy
  • Boise, ID
View GitHub Profile
@JaisonBrooks
JaisonBrooks / 0000_packages.config
Created December 2, 2016 17:10 — forked from gcarrion-gfrmedia/0000_packages.config
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []
@JaisonBrooks
JaisonBrooks / application.html.erb
Created January 26, 2016 23:24 — forked from suryart/application.html.erb
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@JaisonBrooks
JaisonBrooks / getting_started.md
Created December 10, 2015 15:07 — forked from boddhisattva/getting_started.md
Writing a spec from scratch for a plain ruby script(no rails) using TDD

Steps -

  • Create the filename.rb file for which you’d like to create a filename_spec.rb
  • Run the command rspec --init from the same working directory as to where you have filename.rb
  • the above command will create a .rspec file for you
  • It will create a new spec directory within which you need to place your specs
  • It will create spec_helper.rb where you need continually require the ruby files that you would want to write specs for
  • Create the filename_spec.rb within the spec directory
  • [optional] Edit the .rspec file to add the option: --format documentation
  • The above addition gives your running tests more readability as to what they do or what they stand for when they are run.
@JaisonBrooks
JaisonBrooks / Capistrano 3.md
Last active September 16, 2015 19:32 — forked from stevenyap/Capistrano 3.md
Capistrano 3 Setup

This guide explains the way to setup a production server using Capistrano.

Setup Capistrano on LOCAL

  • Capistrano is a development gem which assist the developer to run commands on the production server (something like a Heroku toolbelt)
  • Hence, it is installed and configured on developer's computer
# Gemfile

# Use Capistrano for deployment
@JaisonBrooks
JaisonBrooks / example.rb
Last active September 10, 2015 21:49 — forked from erikeldridge/example.rb
A utility for signing an url using OAuth in a way that's convenient for debugging
require 'oauth_util.rb'
require 'net/http'
o = OauthUtil.new
o.consumer_key = 'examplek9SGJUTUpocjZ5QjBJmQ9WVdrOVVFNHdSR2x1TkhFbWNHbzlNQS0tJnM9Y29uc3VtkZXJzZWNyZXQmeD0yYg--';
o.consumer_secret = 'exampled88d4109c63e778dsadcdd5c1875814977';
url = 'http://query.yahooapis.com/v1/yql?q=select%20*%20from%20social.updates.search%20where%20query%3D%22search%20terms%22&diagnostics=true';
package your.package;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.graphics.Palette;
import com.squareup.picasso.Picasso;
import your.package.PaletteTransformation;
import static your.package.PaletteTransformation.PaletteCallback;
package your.package;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.graphics.Palette;
import com.squareup.picasso.Picasso;
import your.package.PaletteTransformation;
import static your.package.PaletteTransformation.PaletteCallback;
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files