Skip to content

Instantly share code, notes, and snippets.

function chooseGraphFromTypes(omm, influencer) {
if (omm == 'nominal' || influencer == 'nominal') {
return "none";
} else if (omm == 'interval' && influencer =='interval') {
return "interval_interval";
} else if (omm == 'number' && influencer == 'number') {
return "numerical_numerical";
} else if (omm == 'ordinal' && influencer == 'ordinal') {
return "ordinal_ordinal";
} else if( omm == 'interval' && influencer == 'number') {
/*! jQuery v1.8.3 jquery.com | jquery.org/license */
(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,funct
top
window
location
external
chrome
v8Intl
document
$
jQuery
CTIsPlayback
def show
params[:page] ||= 1
@user = User.find_by_username!(params[:id].downcase)
@artworks = @user.artworks.paginate(:page => params[:page], :per_page => 10).recent
users_likes_ids = []
if signed_in?
artwork_ids = []
@joshsmith
joshsmith / _.md
Created December 12, 2012 18:14
Another Inlet
- tutorial = @tutorial || Tutorial.new
= simple_form_for tutorial do |f|
= f.input :title, input_html: { class: 'span4' }
= f.input :url, label: 'URL', input_html: { class: 'span4' }
= f.input :description, as: :text, input_html: { class: 'span4' }
= f.submit "Add New Tutorial", class: 'btn btn-success'
class Whatever < ActiveRecord::Base
before_validation :smart_add_url_protocol
validates_format_of :url,
:with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix,
:message => "URL should be in this format: http://google.com"
private
def smart_add_url_protocol
alias gcb='git checkout -b' # Check out a new branch
alias hack='bash ~/hack.sh' # Hack on the branch
alias ship='bash ~/ship.sh' # Ship the feature
alias dwf='bash ~/dwf.sh' # Delete the working feature
alias hsd='hack && ship && dwf' # Hack, ship, delete
require 'rails'
require 'spec_helper'
require 'generator_spec/test_case'
require 'generators/kaleidoscope/kaleidoscope_generator'
describe 'TestMigration' do
include GeneratorSpec::TestCase
destination File.expand_path("../tmp", __FILE__)
arguments %w(photo)
module Kaleidoscope
module InstanceMethods
def colors_for
end
def generate_colors
Kaleidoscope.log("Generating colors.")
end
def destroy_colors