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
user nginx; | |
worker_processes 8; | |
error_log /var/deploy/lola-live/web_head/shared/log/nginx_error.log; | |
events | |
{ | |
worker_connections 1024; | |
accept_mutex off; | |
} |
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
<boards> | |
<!-- | |
SJFW http://reprap.org/wiki/Sjfw | |
--> | |
<board name="Mega1280" icon="icon-mb24.png"> | |
<version major="1" minor="0"/> | |
<programmer class="replicatorg.uploader.AvrdudeUploader"> | |
<protocol>stk500v1</protocol> | |
<speed>57600</speed> | |
<arch>m1280</arch> |
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
['addresses', 'orders'].each do |includable| | |
describe "includes #{includable}" do | |
let!(:association) { create(includable.singularize, user: user) } | |
it "GET self" do | |
get "/api/v2/users/#{user.id}", {'include' => includable}, headers || {} | |
expect(json['user']).to include(includable) | |
(json[includable][0]).each do |k, v| | |
expect(v).to eq(association[k]) |
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
day_of_month | count | |
--------------+------- | |
1 | 20 | |
2 | 43 | |
3 | 42 | |
4 | 32 | |
5 | 22 | |
6 | 19 | |
7 | 39 | |
8 | 32 |
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
c_path=`tput setaf 6` | |
c_stgd=`tput setaf 2` | |
c_unstgd=`tput setaf 9` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then | |
gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') |
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
# in config/initializers/foo.rb | |
Media.send :include, MediaConcern | |
# in concerns/media_concern.rb | |
require 'active_support/concern' | |
module MediaConcern | |
extend ActiveSupport::Concern | |
included do |
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 origin | |
purchase_order.shipper.location if purchase_order.shipper | |
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
$(function() { | |
var avatar_uploader = new plupload.Uploader({ | |
runtimes: 'html5,flash,html4', | |
container : 'avatar-upload', | |
browse_button : 'avatar-browse', | |
url : '<%= upload_image_user_path %>', | |
max_file_size: '10mb', | |
multiple_queues: true, | |
flash_swf_url : '/plupload/plupload.flash.swf', | |
multipart: 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
class Category < ActiveRecord::Base | |
has_many :subcategories, :dependent => :destroy | |
has_many :users, :through => :subcategories | |
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
# This.. | |
Category.first.users | |
# ..generates this: | |
SELECT "users".* FROM "users" INNER JOIN "categorizations" ON "users"."id" = "categorizations"."user_id" INNER JOIN "subcategories" ON "categorizations"."subcategory_id" = "subcategories"."id" WHERE "subcategories"."category_id" = 1 | |
# Is there something like this.. |
NewerOlder