Skip to content

Instantly share code, notes, and snippets.

View angelsystem's full-sized avatar

angel roberto angelsystem

View GitHub Profile
module Thumbnailable
extend ActiveSupport::Concern
def thumbnail_original
raise NotImplementedError
end
def thumbnail_path
return unless thumbnail?
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
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!
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
@angelsystem
angelsystem / lock.swift
Created December 12, 2017 15:51
function que bloquea la vista si la version no es la minima
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)")