This file contains hidden or 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 Api::V1::BaseController < ActionController::Base | |
| include ActionController::HttpAuthentication::Basic | |
| protect_from_forgery with: :null_session | |
| before_filter :require_current_user | |
| respond_to :json | |
| rescue_from AccessDenied do |exception| |
This file contains hidden or 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
| { | |
| "ticket": { | |
| "custom_fields": [ | |
| { | |
| "id": "424242424", | |
| "value": "child_of:42" | |
| } | |
| ] | |
| } | |
| } |
This file contains hidden or 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
| { | |
| "ticket": { | |
| "fields": { | |
| "424242424": "child_of:42" | |
| } | |
| } | |
| } |
This file contains hidden or 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
| $('img[src*="http://www.we-are-coders.com"]').each(function(){ | |
| $(this).attr('src', $(this).attr("src").replace(/http:\/\/www.we-are-coders.com/g, '')); | |
| }); |
This file contains hidden or 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
| uniq = [] | |
| inject([]) do |memo, e| | |
| uniq_value = block ? block.call(e) : e | |
| uniq.include?(uniq_value) ? memo.push(e) : uniq.push(uniq_value) | |
| memo | |
| end |
This file contains hidden or 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
| App::Application.routes.draw do | |
| scope module: 'company', constraints: ValidSubdomain do | |
| root to: "home#index" | |
| match 'login' => 'sessions#new', as: :login | |
| match 'logout' => 'sessions#destroy', as: :logout | |
| end | |
| scope module: 'invalid_subdomain', constraints: InvalidSubdomain do | |
| match '/*path' => 'home#index' |
This file contains hidden or 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
| Establishment has_many Product has_many Period. | |
| I need to scope the search on multiple criteria : | |
| Where: | |
| Establishment: (geo_location/name) | |
| Where: | |
| Product: (name/type) | |
| Where: | |
| Period: (start_date/end_date) |
This file contains hidden or 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 SeoContentable | |
| extend ActiveSupport::Concern | |
| included do |
This file contains hidden or 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
| Basically i had : | |
| class Base | |
| def self.match_attributes(hash, attributes = self::ATTRIBUTES_MAPPING) | |
| #do work on attributes | |
| end | |
| end | |
| class SpecificMapper < Base | |
| ATTRIBUTES_MAPPING = { ... } |
This file contains hidden or 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
| -> % sudo apt-get install emacs-snapshot-el emacs-snapshot-gtk emacs-snapshot | |
| Reading package lists... Done | |
| Building dependency tree | |
| Reading state information... Done | |
| The following extra packages will be installed: | |
| emacs-snapshot-bin-common emacs-snapshot-common | |
| The following NEW packages will be installed: | |
| emacs-snapshot emacs-snapshot-bin-common emacs-snapshot-common emacs-snapshot-el emacs-snapshot-gtk | |
| 0 upgraded, 5 newly installed, 0 to remove and 5 not upgraded. | |
| Need to get 0 B/40.4 MB of archives. |