Skip to content

Instantly share code, notes, and snippets.

@ancorcruz
ancorcruz / RailsCookieDebugging.rb
Created March 18, 2021 12:34 — forked from danmayer/RailsCookieDebugging.rb
Debugging Growing Cookies and Cookie Overflows
####
# This can be inserted in a before filter, or an endpoint causing cookie overflows
# this will log data for users who are approaching the max_cookie_size
# it will also for the most common cookie to overflow session, break down the size by key value pairs.
# This logs cookie and key names, but none of the data which may include PII, it just logs the byte sizes
#
# How to read:
# Cookie Debug (size: 3280) # overall cookies total size in bytes
# [COOKIE_NAME] size=IN_BYTES # these are sorted by smallest to largest byte size
# session: [KEY] size=IN_BYTES # for the session cookie, the key name with values in byte size sorted

Hello,

We are looking for a Full Stack Software Developer at Made in Memphis Entertainment.

About us:

We are building an all-powerful catalogue management tool for the music industry. It automatically tags metadata for tracks and artists using algorithms and the industry's data in order to improve the process of finding, curating and sharing music. All that presented with a beautiful and powerful interface. We are a building the product for ourselves and our customers. Our powerful platform has one purpose: empower music and sync managers.

We are looking for a software engineer/developer with professional experience in Ruby on Rails and ReactJS. A successful candidate will be working alongside a small team of highly talented engineers to build and maintain new features for our media and entertainment platform, automate processes, build reusable components and develop user-facing features.

The following is a list of places where you can find job offers as a Rails developer:
http://www.workingnomads.co/jobs
https://weworkremotely.com/jobs/search?term=rails
https://jobs.github.com/
http://www.indeed.com/q-Ruby-On-Rails-Developer-jobs.html
http://careers.stackoverflow.com/jobs/tag/ruby-on-rails
http://www.authenticjobs.com/#search=rails
# Spain Only
# Sprockets 2 does this, but Sprockets 3 axed this feature.
namespace :deploy do
after :normalize_assets, :gzip_assets do
on release_roles(fetch(:assets_roles)) do
assets_path = release_path.join('public', fetch(:assets_prefix))
within assets_path do
execute :find, ". \\( -name '*.js' -o -name '*.css' \\) -print0 | xargs -0 gzip --keep --best --quiet --force"
end
end
end
@ancorcruz
ancorcruz / irpf.rb
Last active August 29, 2015 14:14 — forked from fxn/irpf.rb
# Usage:
#
# ruby irpf.rb tax_base
#
# Example:
#
# ruby irpf.rb 65300
# 65300 €, 22722 €, 34.8%
#
# Where 22,722 € is the IRPF to pay, and 34.8% is the real rate, that is,
@ancorcruz
ancorcruz / copy-s3-bucket.rb
Created October 25, 2012 13:12 — forked from zefer/copy-s3-bucket.rb
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)
@ancorcruz
ancorcruz / playing with irb
Created March 5, 2012 15:15
Ruby hash bug
1.9.3p0 :001 > h = Hash.new([])
=> {}
1.9.3p0 :002 > h[:a] << 1
=> [1]
1.9.3p0 :003 > h
=> {}
1.9.3p0 :004 > h[:a]
=> [1]
1.9.3p0 :005 > h[:b] = [2]
=> [2]
@ancorcruz
ancorcruz / Instructions.markdown
Created January 25, 2012 11:05 — forked from albertoperdomo/Instructions.markdown
Setting up a new machine

Setting up a new Mac for web development with Rails

This is my own howto to setup new machines, but you might find it helpful as well.

## General settings

  • In Finder -> Preferences set it to show your home folder, hard drives, external drives, filename extensions, etc.
  • Make Finder show Library: run chflags nohidden ~/Library/ within a terminal
  • Disable holding key pressed to display accents and enable repeat keys: defaults write -g ApplePressAndHoldEnabled -bool false
  • In Preferences->Dock Select "Scale Effect" in the "Minimize Using" field and deselect the "Animate Opening Applications" option.
@ancorcruz
ancorcruz / gist:557664
Created August 30, 2010 16:48
Instalación y configuración de servidor de comet
#Importante: resetear el single_access_token de los usuarios que no tengan
cd /var/www/apps/pareja10/current
script/console staging (o production)
User.find_each do |u|
unless u.single_access_token?
u.reset_single_access_token
u.save(false)
end
end
# Login and change root password
# create the user account you are going to use to connect
adduser myuser
# add the user to sudoers
visudo
#add a line like this at the end
myuser ALL=(ALL) ALL