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
# Public: A module to be mixed in another class with common methods to index | |
# records in ElasticSearch. | |
# | |
# The host object needs to respond to 'indexed_attributes', which will return | |
# an array of the attributes names to be indexed. | |
# | |
# It's also recommended to override the 'save?' method to make sure only | |
# records that match some specifications are indexed. | |
# | |
# The type used for the ElasticSearch index will be extracted from the name of |
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
require 'spec_helper' | |
require 'rspec_api_documentation/dsl' | |
resource "Pusher Webhooks" do | |
let(:user) { Fabricate(:user) } | |
let(:channel) { YOUR_CHANNEL_NAME } | |
post '/api/pusher_webhook' do | |
let(:pusher_key) { YOUR_PUSHER_KEY } | |
let(:pusher_secret) { YOUR_PUSHER_SECRET } |
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
module Hypermodel | |
module ClassMethods | |
# Public: Adds a new link to the _links section of the representation. | |
# | |
# relation - A String or Symbol with the name of the relation. It will | |
# also be used as a method name to call in the Hypermodel | |
# class or in the resource (as a second option) to get the href | |
# if no href provided. | |
# href - An optional String with the href of the link. | |
# options - An optional hash to add to the link (like tempalted: 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
require 'formula' | |
class Macvim < Formula | |
homepage 'http://code.google.com/p/macvim/' | |
url 'https://github.com/b4winckler/macvim/tarball/snapshot-64' | |
version '7.3-64' | |
sha1 'c8bf2d758f52a1173112138fefbf4e5ab08015ff' | |
head 'https://github.com/b4winckler/macvim.git', :branch => 'master' |
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
# Read last HAL draft first: http://tools.ietf.org/html/draft-kelly-json-hal-03 | |
api = MyBlogAPI.new | |
# Entry point | |
api.links #=> {'self' => link_to_self, 'relation' => link1} | |
api.links.self.url #=> '/' | |
api.embedded #=> {} | |
# Links |
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 do_it(ids) | |
contacts = contact_finder(ids) | |
contacts = contacts.my_nice_scope if should_apply_nice_scope? | |
contacts | |
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
One of the possible consequences of the welfare state is the lack of culture of the effort. Everything is easy and free. | |
A clear example is the university (at least in Spain), it's very easy to get to college (both financially and academically), | |
but since it is almost free it is not given enough importance: it's OK if I spend the day lying on the grass or don't | |
go to class or I just left college because the cost is zero. | |
Details of abandonment: http://www.consumer.es/web/es/educacion/universidad/2010/03/21/191878.php (Spanish) | |
Just see the last few years in Spain, the real estate boom is the best example of the lack of the culture of effort. |
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
Oriols-Mac-Pro:test_3_2_1 $ bundle exec rails console | |
Loading development environment (Rails 3.2.1) | |
~> Console extensions: wirble hirb ap rails2 rails3 pm interactive_editor blueprints | |
1.9.3-p0 :001 > Subject.first.student_ids | |
SCHEMA (0.3ms) SHOW client_min_messages | |
SCHEMA (0.1ms) SET client_min_messages TO 'panic' | |
SCHEMA (0.1ms) SET standard_conforming_strings = on | |
SCHEMA (0.0ms) SET client_min_messages TO 'notice' | |
SCHEMA (0.3ms) SET time zone 'UTC' | |
SCHEMA (0.1ms) SHOW TIME ZONE |
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
module ValidateSpanishVat | |
module ClassMethods | |
# Implements model level validator for Spanish's VAT number. | |
# Usage: | |
# | |
# Inside a model with a vat field, simply put | |
# | |
# validates_spanish_vat field_name | |
# | |
def validates_spanish_vat(*attr_names) |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x00000001000225b1 _ZN8rubiniusL12segv_handlerEi + 241 | |
1 libSystem.B.dylib 0x00007fff8666067a _sigtramp + 26 | |
2 ??? 0x0000000102ecf080 0x0 + 4344049792 | |
3 rbx 0x00000001002136b6 _ZN8rubinius16GarbageCollector11scan_objectEPNS_6ObjectE + 182 | |
4 rbx 0x0000000100211d6b _ZN8rubinius7BakerGC14copy_unscannedEv + 283 |