Skip to content

Instantly share code, notes, and snippets.

View SeaOfLee's full-sized avatar

Lee Richardson SeaOfLee

View GitHub Profile
Request URL:https://vapi-dev.getvictorious.com/v1/app/134/app_room/create
Request Method:POST
Status Code:500
Remote Address:54.192.139.221:443
Referrer Policy:no-referrer-when-downgrade
// RESPONSE HEADERS
access-control-allow-credentials:true
access-control-allow-headers:origin, content-type, accept, authorization, aid, X-Forwarded-Proto, X-Cms-Access-Token, X-App-Id
access-control-allow-methods:GET, POST, PUT, DELETE, OPTIONS, HEAD
@SeaOfLee
SeaOfLee / SelectionSort.md
Created March 24, 2015 16:54
Selection Sort

Selection sort is an in-place comparison sort. It is inefficient on large lists, and generally performs worse than the similar insertion sort.

Selection sort divides the input list into two parts: the sublist of items already sorted (built up from left to right at the front of the list), and the sublist of remaining unsorted items that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.

Works well on small files, inefficient for large lists. Almost always outperformed by the similar insertion sort algorithm. Big O performance is poor compared to other algorithms.

In an effort to better understand the fantastic Zurb Foundation front-end framework, I ran into some serious issues. The 'foundation-rails' gem for Ruby on Rails makes it easy to get Foundation into a Rails app, but I found the documentation slightly confusing. The rails g foundation:install command performs many actions for you, creating files and adding necessary javascript to the application.js file. There is one crucial step that is not done for you, you need to add *= require foundation to the application.css file.

If you're curious to make a new dummy app with Zurb Foundation & Rails, here's the steps.

rails new <yourappname> -T

In the Gemfile, add gem 'foundation-rails.

bundle

###Security Workshop

Create a scope on a model class that is vulnerable to an SQL injection attack

@users = User.find(:all, :conditions => “name like #{params[:name]}”)

Answer: "What is the problem with commands like eval?"

@SeaOfLee
SeaOfLee / addsearchkick.md
Last active November 3, 2016 01:23
Add Searchkick to Rails 4 Project

##Add Searchkick to Rails 4 Project Shoutout to Ankane for creating the Searchkick gem. Also props to Mackenzie Child for his wonderful tutorial "How To Build a Movie Review App in Rails 4". At the end of the tutorial he covers how to install search into an app via the searchkick gem.

Download and install Java.

Install elasticsearch from the CLI:

$ brew install elasticsearch

If you already have elasticsearch installed, you can get more info:

@SeaOfLee
SeaOfLee / TeamGitWorkflow.md
Last active August 29, 2015 14:16
A simple workflow using branches and pull requests for a team project with Git & GitHub