Skip to content

Instantly share code, notes, and snippets.

View Pcushing's full-sized avatar

Patrick Cushing Pcushing

View GitHub Profile
{
"organizations_2015_02_06": {
"mappings": {
"issuer": {
"properties": {
"avatar_thumbnail_url": {
"type": "string"
},
"created_at": {
"type": "date",
@Pcushing
Pcushing / launch_darkly_wh_ex.rb
Last active August 29, 2015 14:08
Launch Darkly in Rails App
# You may need to add /lib to your autoload paths in /config/application.rb
config.autoload_paths += %W(#{config.root}/lib)
# /lib/extensions/launch_darkly.rb
module Extensions
module LaunchDarkly
def self.included(c)
return unless c
c.helper_method :pilot_navbar? # anything that needs view-level control
end
$('#filepicker-single-license').on('click', function(e){
e.preventDefault();
var featherEditor = new Aviary.Feather({
apiKey: '1V6FW064w0CkvYNV2rihHg',
apiVersion: 2,
tools: ['crop', 'orientation', 'blemish'],
onSave: function(imageID, newURL) {
// var newFPFile = new FPFile({url: newURL}); //Need to get this piece working
filepicker.store(
newURL, //this isn't right, need to pass a FPFile object or something similar
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://socrates.devbootcamp.com/sql.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://socrates.devbootcamp.com/sql.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: http://socrates.devbootcamp.com/sql.html -->
<sql>
<datatypes db="mysql">
<group label="Numeric" color="rgb(238,238,170)">
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
<type label="Single precision" length="0" sql="FLOAT" quote=""/>
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
@Pcushing
Pcushing / todo_spec.rb
Created June 28, 2012 00:29
spec for todo app with Sung
require 'rspec'
require 'simplecov'
SimpleCov.start
require './list.rb'
require './task.rb'
describe Todo::List do
before :each do
@Pcushing
Pcushing / week3JsExercises.js
Created June 27, 2012 02:56
Week3 JS exercises
function hello(firstName, lastName) {
printResults(["Hello",firstName,lastName].join(' '), "http://socrates.devbootcamp.com/labs/ruby-intro/strings/greeter");
}
function favoriteNumber(guess){
myFavoriteNumber = 4;
if (guess > myFavoriteNumber) {
printResults("Too high, Vi...", "http://socrates.devbootcamp.com/labs/ruby-intro/branching/favorite-number");
} else if (guess < myFavoriteNumber) {
@Pcushing
Pcushing / week3JsExercises.html
Created June 27, 2012 02:56
js week3 exercises
<!DOCTYPE html>
<head>
<title>Week 3 Exercises... sort of like yoga</title>
<script type="text/javascript" language="javascript" src="patrickCushing_allExercises.js"></script>
<!-- Just wanted to see what jquery was all about so feel free to remove this for ease of reading.
It would have been cooler if I'd gotten hide / expand working to show the code instead -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
@Pcushing
Pcushing / sudoku.rb
Created June 26, 2012 04:31
solving sudoku... sorta
class Cell
attr_reader :number, :row, :column, :box
attr_accessor :value
# cell = {num: 1, value: [1,3,5], row: 2, column: 2, box: 9}
def initialize(cell_number, cell_value)
# Cells, rows, columns, and boxes all start at 0
cell_to_box_map = { 0 => 0, 1 => 0, 2 => 0, 9 => 0, 10 => 0, 11 => 0, 18 => 0, 19 => 0, 20 => 0,
3 => 1, 4 => 1, 5 => 1, 12 => 1, 13 => 1, 14 => 1, 21 => 1, 22 => 1, 23 => 1,
6 => 2, 7 => 2, 8 => 2, 15 => 2, 16 => 2, 17 => 2, 24 => 2, 25 => 2, 26 => 2,