Skip to content

Instantly share code, notes, and snippets.

View PericlesTheo's full-sized avatar
👋
I will eventually write something on my blog

Pericles Theodorou PericlesTheo

👋
I will eventually write something on my blog
View GitHub Profile
@brenogazzola
brenogazzola / migrate_im_to_vips.md
Last active March 17, 2024 21:56
Steps to migrate ImageMagick to Libvips

For apps built before the image_processing gem became the default, the migration will involve two steps:

  1. Migrating to the image processing syntax while still using ImageMagick;
  2. Switching to Vips and updating the compression options;

Migrate to the image processing syntax

Before changing from ImageMagick to Vips, it's better to first test the new syntax and ensure everything is still working.

1. Move everything that has to do with compression to a saver hash:

variant(format: :jpg, strip: true, quality: 80)
@patshaughnessy
patshaughnessy / gist:81b40188214259678541
Last active August 29, 2015 14:21
A quick look at when ActiveRecord instantiates Ruby objects
With regard to this twitter conversation:
https://twitter.com/PericlesTheo/status/601745115074420736
Hi Pericles,
This morning I took a quick look at how ActiveRecord converts the query result
back into Ruby objects.
Here’s where it happens:
@include
include / kiss_docker
Created July 2, 2014 14:09
homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
#homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ brew tap caskroom/homebrew-cask
$ brew install brew-cask
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew tap homebrew/completions
$ brew install vagrant-completion
@pyk
pyk / active-record-migration-expert.md
Last active August 2, 2021 09:20
become active record migration expert (Rails 4.0.2)

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@IanVaughan
IanVaughan / uninstall_gems.sh
Created June 9, 2012 20:37
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')