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
Redirecting... | |
<script language="javascript"> | |
<!-- | |
if(!window.location.search.substring(1) == "full=true") { // do not redirect if querystring is ?full=true | |
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Blackberry/i) || navigator.userAgent.match(/WebOs/i)) { // detect mobile browser | |
window.location.replace("http://url-of-your-mobile-page"); // redirect if mobile browser detected | |
} | |
} | |
--> | |
</script> |
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
document.addEventListener('DOMContentLoaded', function() { | |
var userAgent = window.navigator.userAgent.toLowerCase(), | |
safari = /safari/.test(userAgent), | |
ios = /iphone|ipod|ipad/.test(userAgent); | |
if(ios) { | |
if (!safari) { | |
// ios webview | |
document.getElementById("header").style.display = "none"; | |
document.getElementById("nav-toggle").style.display = "none"; |
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
"nonImapInfo" : { | |
"blackhole@fusi0n_org::imap_googlemail_com" : { | |
"Folder_Name" : { | |
"attributes" : { | |
"HasChildren" : false, | |
"HasNoChildren" : true, | |
"Noinferiors" : false, | |
"Marked" : false, | |
"Noselect" : false | |
"ServerId" : "asdf-1234", |
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 Question < ActiveRecord::Base | |
attr_accessible :crowd_id, :question_type, :body, :priority, :choices_attributes | |
belongs_to :crowd | |
has_many :choices | |
accepts_nested_attributes_for( | |
:choices, | |
:reject_if => lambda{ |c| c[:body].blank? } |
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
# This model represents a User of the system. The main User functionality is declared | |
# using the `authable_user` command which is defined as a part of the Challah gem. | |
# | |
# Users can be registered with a username and password (admin only) or directly on the site | |
# from Facebook. If a user was registered with Facebook, they will have a `fb_identifier` | |
# and a `fb_access_token` value. If these values are present, the user will not be able to log | |
# in with a username/password combination. | |
# | |
# ## Columns | |
# * :first_name - First name |
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
module RedisCounter | |
# increment counters | |
def self.incr(name, uniq_key=nil) | |
time = Time.now | |
REDIS.multi do |r| | |
key_names.each do |key_name| | |
# count | |
incr_key = send("#{key_name}_key", name, time) |