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
func showBlockerViewByVersionIfNeeded() { | |
if let version = Bundle.main.releaseVersionNumber { | |
let verifyAppURL = WURL.verifyAppVersion!+"?version=\(version)"+"&os=ios" | |
_ = Server.instance.request(method: .get, URLString: verifyAppURL, response: { (result) in | |
switch result { | |
case .success(let value): | |
print("value: \(value)") |
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 Participante | |
attr_accessor :nombre, :edad, :dni, :cinturon, :partidaGanada, :partidaEmpatada, :partidaPerdida, :puntajeTotal | |
def initialize args | |
args.each do |k,v| | |
instance_variable_set("@#{k}", v) unless v.nil? | |
end | |
@puntajeTotal = puntaje_total | |
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
import UIKit | |
import PureLayout | |
class EmptyBackgroundView: UIView { | |
private var topSpace: UIView! | |
private var bottomSpace: UIView! | |
private var imageView: UIImageView! | |
private var topLabel: UILabel! | |
private var bottomLabel: UILabel! |
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 thumbnail | |
raise ActionController::RoutingError.new('Not Found') unless @file.thumbnail? | |
if stale?(@file, public: true, template: false) | |
send_file(@file.thumbnail_path, disposition: 'inline', type: 'image/png', filename: thumbnail_filename) | |
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
module Thumbnailable | |
extend ActiveSupport::Concern | |
def thumbnail_original | |
raise NotImplementedError | |
end | |
def thumbnail_path | |
return unless thumbnail? |
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
a { | |
colour: brand-colour(blue); | |
&:hover { | |
colour: brand-colour(blue, dark); | |
} | |
} |
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 'rails_helper' | |
RSpec.describe 'creating_seller_profile', type: :feature do | |
context 'create a new seller profile', js: true do | |
let!(:seller) { create(:seller) } | |
before do | |
log_in_as_seller(seller) | |
end | |
it 'should create a seller profile' do | |
visit new_seller_seller_profile_path(seller) |
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 SumarDigitos | |
def sumar_numbers(number) | |
sum = 0 | |
number.to_s.each_char do |n| | |
sum = sum + (n.to_i) | |
end | |
sum | |
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
import UIKit | |
class ViewController: UIViewController, UITextFieldDelegate { | |
@IBOutlet var password: UITextField! //create a delegate in storyboard with viewcontroller and textfield | |
func textFieldShouldReturn(textField: UITextField) -> Bool { | |
password.resignFirstResponder() | |
return 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
import UIKit | |
class ViewController: UIViewController { | |
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { | |
self.view.endEditing(true) | |
} | |
NewerOlder