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
def index | |
@posts = Post.where(draft: false).order('post_date desc') | |
@post_months = @posts.group_by { |p| p.post_date.beginning_of_month } | |
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
working_directory "<%= current_path %>" | |
pid "<%= unicorn_pid %>" | |
stderr_path "<%= unicorn_log %>" | |
stdout_path "<%= unicorn_log %>" | |
listen "/tmp/unicorn.<%= application %>.sock" | |
worker_processes <%= unicorn_workers %> | |
timeout 30 | |
preload_app true |
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
dickeyxxx@dickey-mbp ~/proj/tapjoymarketplace 1.9.3-p194 (mystique ✘)✹✚ | |
✗✗✗ vagrant up | |
[default] Importing base box 'lucid32'... | |
[default] The guest additions on this VM do not match the install version of | |
VirtualBox! This may cause things such as forwarded ports, shared | |
folders, and more to not work properly. If any of those things fail on | |
this machine, please update the guest additions and repackage the | |
box. | |
Guest Additions Version: 4.1.16 |
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
# config/routes.rb | |
require 'admin_constraint' | |
Tapjoyad::Application.routes.draw do | |
# ... | |
scope constraint: AdminConstraint.new do | |
resources :secure_things | |
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
dickeyxxx@dickey-mbp ~/proj/vagrant 2.0.0-dev (master ✘)✹✚✭ | |
✗✗✗ irb | |
irb(main):001:0> RUBY_VERSION | |
=> "2.0.0" | |
irb(main):002:0> def foo(arr: []) | |
irb(main):003:1> p arr | |
irb(main):004:1> arr << 'x' | |
irb(main):005:1> end | |
=> nil | |
irb(main):006:0> foo |
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
# How do I make this: | |
skip_authorization do |current_resource_owner, client| | |
client.application.auto_grant? | |
end | |
# Work with this: | |
!!instance_exec(@server.current_resource_owner, @pre_auth.client) &Doorkeeper.configuration.skip_authorization | |
# in both 1.8 and 1.9, without failures like this: https://travis-ci.org/applicake/doorkeeper/builds/3540040 |
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
# Example: | |
# | |
# dickeyxxx@dickey-mbp ~/proj/tapjoykc 1.9.3-p194 (routes ✔) | |
# ✗✗✗ | |
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then | |
turquoise="%F{81}" | |
orange="%F{166}" | |
purple="%F{135}" | |
hotpink="%F{161}" |
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
count = 0 | |
AdminDevice.all.each do |admin_device| | |
device = Device.find(admin_device.udid) | |
unless device.try(:last_run_time_tester) | |
puts "'last_run_time_tester' was false: #{admin_device.description}" | |
count += 1 | |
end | |
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
/* index performance */ | |
SELECT | |
relname, | |
100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, | |
n_live_tup rows_in_table | |
FROM | |
pg_stat_user_tables | |
WHERE | |
seq_scan + idx_scan > 0 | |
ORDER BY |
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
BW::Location.get do |result| | |
p result[:to].latitude | |
p result[:to].longitude | |
end |
OlderNewer