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
<h5>Tab 1</h5> | |
<!-- Tab 1 content Start --> | |
<div> | |
<p>Tab 1 content</p> | |
</div> | |
<!-- Tab 1 content end --> | |
<h5>Tab 2</h5> | |
<!-- Tab 2 content Start --> | |
<div> | |
<p>Tab 2 content</p> |
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
<!-- Retweet App Snippet --> | |
<link rel='stylesheet' href='http://localhost:3000/assets/retweet.css' /> | |
<script src="//platform.twitter.com/widgets.js"></script> | |
<script src="http://localhost:3000/assets/api.js?t=1"></script> | |
<script type='text/javascript'> | |
var asset_url = "{{ shop.metafields.retweeter.tab_image | asset_url }}"; | |
jQuery(document).ready(function(){ | |
RetweetApi.init({{ shop.metafields.retweeter | json }}, asset_url); | |
}); | |
</script> |
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 ActionController::Base | |
def self.body_class(&block) | |
if block_given? | |
content_for :body_class yield block if block_given? | |
end | |
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
task :test_divide => :environment do | |
puts (12/2).class | |
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
#!/bin/bash | |
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" | |
curl -L https://get.rvm.io | bash -s stable --rails | |
brew install mysql | |
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp | |
mysql.server start | |
echo -e "\033[32m You are all set and ready to rock!\033[0m" |
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 'config/environment' | |
class Entry | |
attr_accessor :completed_on | |
end | |
module EntryUpdate | |
def delete!(id) | |
if entry = Entry.find(id) | |
entry.destroy | |
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
module Verdacom | |
module Base | |
def fallbacks(*args, &block) | |
yield Fallback.new if block_given? | |
end | |
class Fallback | |
attr_accessor :resolver | |
def initialize |
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
#!/usr/local/bin/bin/ruby | |
require 'rubygems' | |
require 'mechanize' | |
require 'redis' | |
@redis = Redis.new | |
@count_key = 'shopify:metarific:install_count' | |
a = Mechanize.new | |
def growl( message ) |
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 |
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 |