I hereby claim:
- I am chrise86 on github.
- I am chrisedwards (https://keybase.io/chrisedwards) on keybase.
- I have a public key whose fingerprint is 5D2F 502D 07D4 F2E2 1CD1 10AA C8CB 36A0 219B 6E85
To claim this, I am signing this object:
| class ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
| end | |
| end | |
| ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
| # | |
| # DO NOT EXPECT THIS WILL RUN AS SHOWN HERE! | |
| # This is an extract from https://github.com/iboard/yarb | |
| # The specs will work only in the full environment of the application. | |
| # | |
| # Anyhow, this example should show you how to define a Boolean-value | |
| # for ruby. | |
| # | |
| # Because HTML-Forms will post checkbox-values as "0"/"1" rather than false/true | |
| # this class will handle 0,"0",false as FalseValue, and 1,"1",true as TrueValue |
| #config/initializers/carrierwave.rb | |
| module CarrierWave | |
| module MiniMagick | |
| # Rotates the image based on the EXIF Orientation | |
| def exif_rotation | |
| manipulate! do |img| | |
| img.auto_orient | |
| img = yield(img) if block_given? | |
| img | |
| end |
| import React, {PropTypes} from 'react'; | |
| import classNames from 'classnames'; | |
| class BatchDropZone extends React.Component { | |
| static propTypes = { | |
| // function that recieves an array of files | |
| receiveFiles: PropTypes.func.isRequired, |
I hereby claim:
To claim this, I am signing this object:
| // transform cropper dataURI output to a Blob which Dropzone accepts | |
| function dataURItoBlob(dataURI) { | |
| var byteString = atob(dataURI.split(',')[1]); | |
| var ab = new ArrayBuffer(byteString.length); | |
| var ia = new Uint8Array(ab); | |
| for (var i = 0; i < byteString.length; i++) { | |
| ia[i] = byteString.charCodeAt(i); | |
| } | |
| return new Blob([ab], { type: 'image/jpeg' }); | |
| } |
| /** @jsx React.DOM */ | |
| var STATES = [ | |
| 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
| 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
| 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
| 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
| ] | |
| var Example = React.createClass({ |
| <form action="/cart/add" method="post"> | |
| {% if product.variants.size > 1 %} | |
| {% if product.options[0] %} | |
| {% assign used = '' %} | |
| <label for="select-one">{{ product.options[0] }}</label> | |
| <select id='select-one' onchange="letsDoThis()"> | |
| {% for variant in product.variants %} | |
| {% unless used contains variant.option1 %} | |
| <option value="{{ variant.option1 }}">{{ variant.option1 }}</option> | |
| {% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %} |
| var util = {}; | |
| /** | |
| * IE8 compatible custom event listener | |
| * @method listenToCustomEvents | |
| * @param {string} eventName Event to listen for | |
| * @param {method} callback Method to run on event | |
| */ | |
| util.listenToCustomEvents = function (event_name, callback) { | |
| if (document.addEventListener) { |
| = form_tag :search, method: :get, id:'search' do |f| | |
| = text_field_tag :q, '', placeholder:'City, address, or zip code' | |
| = hidden_field_tag :c, '' | |
| = submit_tag "Go" |