Skip to content

Instantly share code, notes, and snippets.

View reboryan's full-sized avatar
🏠
Working from home

Ryan Rebo reboryan

🏠
Working from home
View GitHub Profile
@reboryan
reboryan / _.md
Created November 9, 2019 01:13
Deploy React App to Google App Engine

After many failed attempts, this solution worked to get my react app successfully deployed to Google App Engine.

  1. Be sure to run npm run build. This should create a build directory in your root folder.
  2. Reference build files in app.yaml (in your root). Create if doesn't exist. This worked for me:
# [START runtime]
runtime: nodejs
env: flex
# [END runtime]
class EncodeMp3Service
def self.encode(song_version_id, input_filepath)
new(song_version_id, input_filepath).encode
end
def initialize(song_version_id, input_filepath)
@song_version = SongVersion.find song_version_id
@input_filepath = input_filepath
end
module Pipeline
extend ActiveSupport::Concern
included do
# @!attribute [rw] pipeline_id
attr_accessible :pipeline_id
end
def post_url(remote_resource_name)
"#{Rails.application.config.pipeline[:api_url]}/#{remote_resource_name}.json?api_key=#{Rails.application.config.pipeline[:api_key]}"
@reboryan
reboryan / search_params_parser.rb
Last active February 21, 2019 02:52
Dynamic Query String Builder
module Search
# takes in parameters via filters and keywords (search bar) from browse page,
# performs parsing and prepares bits of SQL that can be used to build a full query
# see search_query_builder.rb for where these bits of SQL get used
class SearchParamsParser
KEYWORD_TYPES = %w{search lyrics artists songVersions}
FILTER_TYPES = %w{mood instruments vocals energy genres customizable length arc internal}
ORDER_OPTIONS = ['last_created DESC', 'last_created ASC', 'title ASC', 'title DESC', 'length ASC', 'length DESC', 'random()'].freeze
@reboryan
reboryan / order_controller.rb
Created November 24, 2014 22:12
Uploading PDF receipt to S3
# process order
def complete
user = current_or_guest_user
@order = user.orders.find(params[:order][:id])
@order = validate(@order, params)
stripe_card_token = params[:order].delete :stripe_card_token if params[:order]
card_or_customer = stripe_card_token || (user.stripe_customer_id && !user.guest?)
@reboryan
reboryan / controller.rb
Created May 15, 2014 15:31
PUT and DELETE routes
#IN THE CONTROLLER
put '/update_blog_post' do
#do stuff to update record
end
delete '/delete_blog_post' do
#do stuff to delete record
end
@reboryan
reboryan / 0_reuse_code.js
Created May 15, 2014 15:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@reboryan
reboryan / oojs.txt
Created May 6, 2014 19:06
OOJS examples
Object literal: -------------------------------- (only one instance of an object literal, use constructor if multiple instances are needed) -----------------------------------------------------------------------------------------------
var LIT = {
api_key : "2345769590",
init: function(args) {
this.args = args;
},
url: functioun() {
return "http://jdhjdjhsvj.com/" + this.api_key + "/" + this.args;
.ajax({
type: 'post',
url: '/submit',
dataType: 'json'
data: form.serialize();
}).done(response){
$('#display').html(response.email);
@reboryan
reboryan / jquery_example.md
Last active August 29, 2015 13:57 — forked from dbc-challenges/jquery_example.html
Jquery Manipulation

##Link to the page

<!DOCTYPE html>
<html>

<head>
   
    <title>DOM manipulation with jQuery</title>