most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
########################################################################## | |
# Problem: The Clocks problem | |
# Description: suppose you have 2 clocks with the following conditions: | |
# + one clock put forward one minute each hour; and | |
# + the other clock put back one minute each hour | |
# Having both clocks showing the same time, the question is: | |
# + how long we should wait until they show the same time again? | |
# | |
# Solution by Ariel Diaz Bermejo |
class Person | |
has_many :person_telephones | |
... | |
def mobile_numer | |
phone = self.person_telephones.first(:conditions => ["`person_telephones`.kind = ?", 'KIND_MOBILE']) | |
phone.number if phone | |
end |
s = Store.last | |
s_name = s.name.upcase | |
s_address = s.address.address_1 + s.address.address_2 | |
s_city = s.address.city | |
s_zip = 'Zip: ' + s.address.zipcode | |
label_path = Rails.root.join('public', 'images', 'ltl_label.png').to_s | |
barcode_file= "1318364275.png" ### <--- Aca ponete el string de un barcode que tengas en tu disco, en "public/images/barcodes/" | |
output_path = "#{Rails.root}/tmp/ltl_label_#{barcode_file}" | |
label = Magick::Image.read(label_path).first |
<soap:Envelope xmlns="http://www.w-w-i-s.com/hb/51" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > | |
<soap:Header> | |
<Credentials> | |
<HMac>string</HMac> | |
<ClientID>AHHRV</ClientID> | |
<UserName>ariel1234</UserName> | |
<Password>worldwide1</Password> | |
</Credentials> | |
</soap:Header> | |
<soap:Body> |
module MyApp | |
class Cart | |
attr_accessor :order, :items # <== ActiveRecord Instance of Order & Item | |
def initialize(user, token) | |
@order ||= user.blank? ? Order.load_for_guest(token) : Order.load_for_customer(user) | |
@items = @order.items | |
end | |
def add(product_id, quantity=1) |
require 'rubygems' | |
gem 'savon', '=1.1.0' | |
require 'savon' | |
WSDL_URL = "https://testenv.w-w-i-s.com/hb/51/api.asmx?wsdl" | |
HMAC = 'string' | |
CLIENT_ID = 'AHHRV' | |
MAIN_HEADER = { | |
'Credentials' => { | |
'HMac' => HMAC, |
# app/models/pd_resource.rb | |
class PdResource < ActiveRecord::Base | |
# ... | |
SORT_OPTIONS = [:alpha, :popular] | |
SORT_CLAUSES = { | |
alpha: "pd_resources.title ASC", | |
popular: "pd_resources.views DESC", | |
} | |
#... | |
end |
class Api::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_action :myTS_authenticate! | |
private | |
def myTS_authenticate! | |
if request.env['PATH_INFO'] =~ /api_data_sync/ | |
data_sync_api_authentication | |
else |
*************************************************************** | |
****** Equipos que PASAN de fase definiendo de VISITANTE ****** | |
*************************************************************** | |
=== Libertadores 2014 (66%) | |
(8) Octavos de final => 6 | |
(4) Cuartos de final => 2 | |
(2) Semifinales => 2 | |
(1) Final => 0 |