Skip to content

Instantly share code, notes, and snippets.

@iovino
iovino / gist:1435830
Created December 5, 2011 23:06
Checks to see if a user is banned or not
SELECT user.username,
IF(usergroup.genericoptions & 32, 0, 1) AS is_banned
FROM user as user
INNER
JOIN usergroup AS usergroup
ON usergroup.usergroupid = user.usergroupid
WHERE userid = 1;
@iovino
iovino / google_dfp_order_service.rb
Last active December 14, 2015 06:09
Returns all approved orders from a Google DFP account via their API using their Ruby gem 'google-dfp-api'.
require 'dfp_api'
dfp = DfpApi::Api.new
order_service = dfp.service(:OrderService, :v201211)
order_results = order_service.get_orders_by_statement({
:query => 'WHERE status = :order_status LIMIT 500',
:values => [
{:key => 'order_status',
:value => {:value => 'APPROVED', :xsi_type => 'TextValue'}}
]
@media only screen and (max-device-width: 540px), only screen and (min-device-width: 560px) and (max-device-width: 1136px) and (-webkit-min-device-pixel-ratio: 2) {
body {
min-width: 320px !important;
max-width: 320px !important;
overflow: hidden;
}
.full-width{width:320px !important;}
#main-outlet {
padding-top: 95px !important;
}
@iovino
iovino / gist:6299293
Created August 21, 2013 19:50
This query will return true if the selected usergroup is marked as the banned group:
SELECT IF(usergroup.genericoptions & 32, 0, 1) AS is_banned_group
FROM usergroup as usergroup
WHERE usergroup.usergroupid = 8;