This file contains 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 Account < ActiveRecord::Base | |
include SimpleTree | |
include Invitation | |
end |
This file contains 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
if (!window.jQuery) { | |
script = document.createElement('script'); | |
script.type = "text/javascript"; | |
script.src = "//code.jquery.com/jquery-1.10.2.js"; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
} | |
setTimeout(function() { | |
jQuery(".ss-form-question .ss-choice-item input").unbind("change").change(function(){ | |
var sum = 0; |
This file contains 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
<!-- input without error --> | |
<input type="text" /> | |
<!-- input with error --> | |
<div class="input_holder_error"> | |
<input type="text" /> | |
<span class="validation-error">Some error</span> | |
</div> |
This file contains 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
var $, Switcher; | |
$ = jQuery; | |
$.fn.extend({ | |
switcher: function(options) { | |
return $(this).each(function(input_field) { | |
var switcher; | |
switcher = $(this).data("switcher"); | |
if (switcher == null) { |
This file contains 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 | |
# Settings | |
APP_ROOT="/Volumes/Data/superp/www/fodojo/writers_cms/" | |
PULSAR_ROOT="/Volumes/Data/superp/www/fodojo/pulsar" | |
APPS=(...) | |
APPS_COUNT=${#APPS[*]} | |
BUNDLE_CMD="bundle update writers_cms" | |
GIT_COMMIT_CMD="git commit -am 'update-cms'" |
This file contains 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
gem("mysql2") | |
gem("devise") | |
gem("sunrise-cms", :path => '/var/www/gems/cms/sunrise') | |
gem("therubyracer", :group => 'development') | |
gem("mongrel", :version => "1.2.0.pre2", :group => 'development') | |
gem("rspec-rails", :version => "~> 2.7.0", :group => 'test') | |
gem("database_cleaner", :version => "~> 0.7.0", :group => 'test') | |
gem("factory_girl_rails", :version => "~> 1.4.0", :group => 'test') | |
gem("fuubar", :group => 'test') |
This file contains 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
.bundle/ | |
.svn/ | |
config/*.yml | |
config/*.conf | |
config/logrotate-config | |
config/nginx-config | |
config/nginx-config-vhost | |
db/schema.rb | |
db/sphinx/ | |
log/ |
This file contains 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 Tweet | |
include MongoMapper::Document | |
key :id_str, String | |
key :from_user_id, Integer | |
belongs_to :track_item | |
def self.grouped_by(column, options = {}) | |
map_function = "function() { emit( this.#{column}, 1); }" |
This file contains 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
# models/person.rb | |
serialize :auth_hash, Hash | |
def facebook | |
@fb_user ||= FbGraph::User.me(user_attributes[:token]) | |
end | |
def twitter | |
@tw_user ||= prepare_access_token(user_attributes[:token], user_attributes[:secret]) | |
end |
This file contains 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
# initializers/omniauth.rb | |
TestStream::Application.config.middleware.use OmniAuth::Builder do | |
provider :facebook, '...', '...', {:scope => 'publish_stream,offline_access,email'} | |
provider :twitter, '...', '...' | |
end |
NewerOlder