Skip to content

Instantly share code, notes, and snippets.

View ckozus's full-sized avatar

Carlos Kozuszko ckozus

  • Insignia
  • Tucumán, Argentina
View GitHub Profile
(function () { var html="<span style=\"font-size:10px; line-height:normal;\" id=\"legalinclude-legal\">\n&trade; and &copy; 2019 Twentieth Century Fox Film Corporation. All rights reserved. Property of Fox. Use of this website (including any and all parts and components) constitutes your acceptance of these <a style=\"text-decoration:underline;\" target=\"_blank\" href=\"https:\/\/www.foxprivacy.com\/us-th\/terms.html\">Terms of Use<\/a> and <a style=\"text-decoration:underline;\" target=\"_blank\" href=\"https:\/\/www.foxprivacy.com\/us-th\/privacy.html\">Privacy Policy<\/a>. The materials on this website are not to be sold, traded or given away. Any copying, manipulation, publishing, or other transfer of these materials, except as specifically provided in the terms and conditions of use, is strictly prohibited.\n<\/span>\n"; var scripts = document.getElementsByTagName('script'); var src = ''; for (var i = 0; i < scripts.length; i++) { if (-1==scripts[i].src.search(/footer(-async)?[.]js/)) continue; src=scri
def submitted?(klass)
found = false
queue = Sidekiq::Queue.new(ENV.fetch('LISTINGS_QUEUE'))
queue.each do |job|
job_class = job.args.first['job_class']
job_argument = job.args.first['arguments'].first
job_event_id = job_argument.try(:to_i)
if job_class == klass.to_s && job_event_id == @event.id
found = true
break
a = Attachment.first
digest = Paperclip::Attachment.default_options[:hash_digest]
secret = Paperclip::Attachment.default_options[:hash_secret]
data = "attachments/files/#{a.id}/original/#{a.updated_at.to_i}"
hash_for_attachment = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.const_get(digest).new, secret, data)
if a.file.url.include?(hash_for_attachment)
puts "correct hash: #{hash_for_attachment}"
else
puts "hash incorrect"
@ckozus
ckozus / listings.rb
Last active September 12, 2017 13:07
{"EventTickets"=>
{"Tickets"=>
{"TicketGroup"=>
[{"EventID"=>"3177936",
"FacePrice"=>"18.63",
"HighSeat"=>"12",
"ID"=>"20879932",
"IsMine"=>false,
"LowSeat"=>"9",
"Marked"=>false,
class Line < ActiveRecord::Base
has_many :buses, dependent: :destroy
has_many :stops, dependent: :destroy
end
class Bus < ActiveRecord::Base
belongs_to :line
end
class Stop < ActiveRecord::Base
<div class="modal">
<label for="modal-3">
<h5>
2 miles away
<i class="icon-star"> </i>
<i class="icon-star"> </i>
<i class="icon-star"> </i>
<i class="icon-star"> </i>
<i class="icon-star"> </i>
</h5>
$(document).ready(function() {
var menuToggle = $('#js-mobile-menu').unbind();
$('#js-navigation-menu').removeClass("show");
menuToggle.on('click', function(e) {
e.preventDefault();
$('#js-navigation-menu').slideToggle(function(){
if($('#js-navigation-menu').is(':hidden')) {
@ckozus
ckozus / .bash_profile
Created June 2, 2015 00:31
Colores para git y versiones de ruby en el prompt de bash
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
function rvm_prompt {
~/.rvm/bin/rvm-prompt
}
export PS1='\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)[$(rvm_prompt)]$ '
namespace :test do
task :parsing do
article_text = <<-eos
;ljaf dsf
asflkj asd;lkfj
sdflkjasf;ajksf
;lkadjsf;asdjf
{{calendar 2015-06-26 2015-06-28}}
class User
has_one :plan
has_many :certificates
def remaining_certificates
plan.available - certificates.current_month.count
end
end