Skip to content

Instantly share code, notes, and snippets.

@yannvery
yannvery / CHRUBY_add_ruby_version.md
Last active December 8, 2023 00:51
CHRUBY - How to install a new ruby version

Install a new ruby version with chruby

OSX

First of all you must update ruby-build to update definitions list.

brew update

And update ruby-build

@yannvery
yannvery / 0_login.rb
Last active July 7, 2023 23:49
Savon Client for SDM webservices - Request examples
require 'savon'
# Get wsdl
client = Savon.client(wsdl: "http://localhost:8080/axis/services/USD_R11_WebService?wsdl")
#login
response = client.call(:login, message: {username: "servicedesk", password: ""})
sid = response.body[:login_response][:login_return]
@yannvery
yannvery / 0_Paginate_without_reload_all_page_with_kaminari.md
Last active November 3, 2022 11:11
How to paginate on an ajax way ( with jquery and kaminari )

Paginate with Kaminari without reload all data

Use :remote => true option on link_to and paginate Region index page

@yannvery
yannvery / ubuntu_cleanup_packages.md
Last active May 19, 2022 09:44
Ubuntu - Purge old kernels and unused modules

Ubuntu - Purge old kernels and unused modules

Purge old kernels

Open terminal and check your current kernel:

uname -r

DO NOT REMOVE THIS KERNEL!

@yannvery
yannvery / extract_events_from_bugsnag.md
Created February 23, 2021 11:13
Extract events from a search error in Bugsnag
@yannvery
yannvery / tracepoint_and_rails_reload!.md
Created February 8, 2016 23:31
TracePoint and Rails reload!

TracePoint and Rails reload! / startup

On a specific rails application (4.2), when a developper call reload! method on a console he'll see:

Engine Load (0.3ms)  SELECT  `engines`.* FROM `engines` WHERE `engines`.`label` = 'influencer' LIMIT 1
Engine Load (0.3ms)  SELECT  `engines`.* FROM `engines` WHERE `engines`.`label` = 'speaker' LIMIT 1
Engine Load (0.3ms)  SELECT  `engines`.* FROM `engines` WHERE `engines`.`label` = 'animator' LIMIT 1
Engine Load (0.2ms)  SELECT  `engines`.* FROM `engines` WHERE `engines`.`label` = 'ambassador' LIMIT 1
Engine Load (0.2ms) SELECT `engines`.* FROM `engines` WHERE `engines`.`label` = 'private_show' LIMIT 1
@yannvery
yannvery / How_to_maintain_fork_sync.md
Created January 20, 2016 09:52
How to maintain fork sync

How to maintain fork sync

Configuring a remote for a fork

To sync changes you make in a fork with the original repository, you must configure a remote that points to the upstream repository in Git.

  • Open a Terminal
  • List current configured remote repository for your fork
git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
@yannvery
yannvery / RSpec_cheatsheet.md
Last active February 22, 2018 20:32
RSpec cheatsheet

RSpec Cheatsheet

Specs layers

 +-----------------------------------------------------------------------------------------+

   +----------+                                                       +------------------+
   |          |                                                       |                  |
   |  View    |                                                       |                  |
   |  Specs   |            View                                       |                  |
@yannvery
yannvery / README.md
Created March 2, 2015 11:39
Untrack files after updating gitignore

To untrack a single file that has already been added/initialized to your repository, i.e., stop tracking the file but not delete it from your system use: git rm --cached filename

To untrack every file that is now in your .gitignore:

First commit any outstanding code changes, and then, run this command:

git rm -r --cached .

This removes any changed files from the index(staging area), then just run:

@yannvery
yannvery / mysql2_load_error.md
Created September 5, 2016 08:55
Load error Mysql2 with an old rails application

When you encounter

/Users/kernel/.gem/ruby/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in 
  `require': dlopen(/Users/kernel/.gem/ruby/2.0.0/gems/mysql2-0.3.16/lib/mysql2/mysql2.bundle, 9): 
    Library not loaded: 
      /usr/local/lib/libmysqlclient.18.dylib (LoadError)

Try gem pristine mysql2, this command restores installed gems to pristine condition from files located in the gem cache