Skip to content

Instantly share code, notes, and snippets.

@xlozinguez
xlozinguez / api_contoller.rb
Created April 11, 2013 16:34
This is the code to hook up an API controller within rails and handle authentication using devise/warden It also includes how to handle the admin role. NOTE: If the user is admin, when the user tries to access a user without the correct id, the system respond with an error. If the user is not an admin, when the user tries to access a user withou…
class Api::ApiController < ActionController::API
before_filter :user_authenticated?
private
def user_authenticated?
unless user_signed_in?
return render :status => 401, :json => {:success => false, :errors => ["Y U NO authenticated?"]}
end
end
@xlozinguez
xlozinguez / compiled
Last active December 15, 2015 16:09
Emblem sexyness
<ul class="dropdown-menu">
<li id="ember328" class="ember-view active" href="#/edit_profile">
<a href="view.href"><i class="icon-user"></i>Profile</a>
</li>
<li id="ember331" class="ember-view" href="#/schedule">
<a href="view.href"><i class="icon-calendar"></i>Schedule</a></li>
</ul>

\n\nA couple additional comments:\n\n·         There is also a new billing wiki: [https://corpwiki.appnexus.com/display/billing/][1]\n\n·         It is one thing to understand the difference between a campaign and line item, and another to give advice to a client on where they should set a budget.  Some guidelines that I have gathered are:\n\no   A line item budget should be used if you are getting paid in CPC or CPA, but is not necessary when you are getting paid in CPM as long as you are setting a campaign budget (see next bullet)\n\no   Always set a campaign budget to control the amount you are spending, or in the case of getting paid CPM, also control the amount your advertiser is spending\n\no   While line item budgets don’t always need to be set as per the above, it can be confusing to use campaign monitor without setting both a line item and campaign budget.  For example, if you have 1 month flight dates on the line item and 1 week flight dates on the campaign and a budget only set on the campaign,

Last login: Mon Feb 27 08:11:18 2012 from 190.145.89.146
[deploy@stage01 ~]$ ssh git@github.com -v
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /home/deploy/.ssh/config
debug1: Applying options for github.com
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.