This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| name : 'Image', | |
| field: 'image', | |
| id: 'image', | |
| width: 30, | |
| sortable: true, | |
| formatter: imageFormatter = function( row, cell, value, columnDef, dataContext ){ | |
| if(dataContext['image_url'] == null){ | |
| return ""; | |
| }else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| editable: true, | |
| enableAddRow: true, | |
| enableCellNavigation: true, | |
| asyncEditorLoading: true, | |
| forceFitColumns: false, | |
| topPanelHeight: 25 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'net/telnet' | |
| class Email | |
| def initialize(address) | |
| @address = address | |
| end | |
| def verify | |
| connect do | |
| cmd("HELO") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href='https://fonts.googleapis.com/css?family=Unna' rel='stylesheet' type='text/css'> | |
| <link href='https://fonts.googleapis.com/css?family=Squada+One' rel='stylesheet' type='text/css'> | |
| <style type="text/css" media="print,screen"> | |
| ul{ list-style: none; } | |
| ul.address{ float: left; width: 40%; } | |
| h1{ font-family: 'Squada One', cursive; } | |
| body{ font-family: 'Unna'; font-style: normal; } | |
| #page{ | |
| padding: 0.5em 1em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'benchmark' | |
| class Array | |
| def missing_sequence | |
| prefix = self[0].split("-")[0] | |
| mapped = self.map{|v| v.split("-")[-1].to_i }.sort | |
| min = mapped[0] | |
| max = mapped[-1] | |
| ((min..max).to_a - mapped).map{ |v| "#{prefix}-#{v}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Study | |
| def self.protocol_nickname | |
| @@protocol_nickname ||= self.first.try(:protocol_nickname) || 'Untitled' | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="canonical" href="{{ canonical_url }}" /> | |
| {% assign maxmeta = 155 %} | |
| {% if template contains 'product' %} | |
| {% assign mf = product.metafields.metarific %} | |
| {% unless mf == empty %} | |
| {% for mf in product.metafields.metarific %} | |
| {% capture key %}{{ mf | first }}{% endcapture %} | |
| {% if key == 'title' %} | |
| <title>{{mf | last}}</title> | |
| <meta name="title" content="{{mf | last}}" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% include 'metarific' %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'aasm' | |
| class User < ActiveRecord::Base | |
| include AASM | |
| aasm_state :new, :initial => true | |
| aasm_state :advanced | |
| aasm_state :expert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # old | |
| def self.load_or_initialize_tz(timezone_name) | |
| first(:conditions => ["RIGHT(tz_name, ?) = ? OR tz_name = ?", timezone_name.size, timezone_name, timezone_name]) || self.first || self.new(tz_name: timezone_name) | |
| end | |
| # new | |
| def self.load_or_initialize_tz( timezone_name ) | |
| first(:conditions => {:tz_name => timezone_name }) || first || new(:tz_name => timezone_name) | |
| end |