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
$.ajax({ | |
type: "POST", | |
url: "/asdf.php", | |
data: $("form").serialize(), | |
error: function() {console.log("aggh")}, | |
success: function(f) { console.log(f)} | |
}) |
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
# Scope to order by a column header in a view's table. | |
# Direction can also be passed as argument (defaults to 'DESC'). | |
# NOTE: Do not use #includes, instead use #joins. See not at CSVExporter. | |
def self.ordered_by_viewable_column(view_column_name, direction = 'DESC') | |
# Direction must be either asc or desc. Default to DESC | |
dir = direction =~ %r{^(asc|desc)$}i ? direction.upcase : 'DESC' | |
case view_column_name | |
when /account/i then joins(:network).order("networks.name #{dir}") | |
when /author/i then joins(:author).order("users.last_name #{dir}, users.first_name #{dir}") | |
when /brand/i then joins(:brand).order("brands.name #{dir}") |
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
- if network.is_a?(TwitterNetwork) | |
%span{:class => network.class.to_s.downcase} | |
= truncate(network.name.to_s, :length => 20) | |
%br | |
%span | |
%a.network_url{:href => "http://twitter.com/#{network.name}"} | |
= "twitter.com/#{network.name}" | |
- elsif network.is_a?(FacebookNetwork) | |
%span{:class => network.class.to_s.downcase} | |
= truncate(network.name.to_s, :length => 20) |
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
%li{:class => (network == n && request.path != '/timeline' ? "active #{n.class.to_s.downcase}" : n.class.to_s.downcase)} | |
- if n.is_a?(TwitterNetwork) | |
-#= link_to "@#{n.name}", networks_twitter_url(n) | |
- url = networks_twitter_url(n) | |
-#= link_to "@#{n.name}", networks_twitter_url(n) | |
- else | |
-#= link_to n.name, networks_facebook_url(n) | |
- url = networks_facebook_url(n) | |
%a{:href => url} | |
-#%label.network{:class => "#{n.class.to_s.downcase}", :for => "sn#{n.class.to_s}"} |
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
expose(:current_brand) do | |
# REFACTOR THIS PLEASE :( | |
if params[:current_brand_id] | |
session[:qp_status] = nil | |
session[:qp_shared_image_ids] = nil | |
brand_id = if current_organization.brands.exists?(:id => params[:current_brand_id]) | |
session[:current_brand_id] = params[:current_brand_id] | |
params[:current_brand_id] |
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
1) PostsController deliver_notifications delivers emails to notifiable users | |
Failure/Error: controller.send(:deliver_notifications, true) | |
<ReviewerNotificationMailer (class)> received :notification_email with unexpected arguments | |
expected: (#<RSpec::Mocks::Mock:0x8707bd90 @name="User">, #<RSpec::Mocks::Mock:0x870816f0 @name=nil>) | |
got: (#<RSpec::Mocks::Mock:0x8707bd90 @name="User">, #<RSpec::Mocks::Mock:0x871a1a30 @name=nil>) | |
# ./app/controllers/posts_controller.rb:177:in `block in deliver_notifications' | |
# ./app/controllers/posts_controller.rb:176:in `each' | |
# ./app/controllers/posts_controller.rb:176:in `deliver_notifications' | |
# ./spec/controllers/posts_controller_spec.rb:361:in `block (3 levels) in <top (required)>' |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
"http://localhost:5400/assets/application.css?body=1" | |
"2970 unused selectors:" | |
applet | |
object | |
h1 | |
h2 | |
h3 | |
h4 | |
h5 |
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
function initSpinner() { | |
var opts = { | |
lines: 16, // The number of lines to draw | |
length: 0, // The length of each line | |
width: 2, // The line thickness | |
radius: 7, // The radius of the inner circle | |
color: '#fff', // #rgb or #rrggbb | |
speed: 0.9, // Rounds per second | |
trail: 25, // Afterglow percentage |
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
--- | |
is_commentable: true | |
is_likable: true | |
is_liked: false | |
num_likes: 0 | |
timestamp: 1324610418712 | |
update_comments: | |
total: 0 | |
update_content: | |
person: |
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
--- | |
api_standard_profile_request: | |
headers: | |
total: 1 | |
all: | |
- !ruby/hash:LinkedIn::Mash | |
name: x-li-auth-token | |
value: name:mm60 | |
url: http://api.linkedin.com/v1/people/Z6BGkDADoB | |
first_name: Christopher |