Skip to content

Instantly share code, notes, and snippets.

@yannvery
yannvery / mount_gcp_disk.md
Last active August 29, 2015 14:22
Mount GCP Disk

How to mount a disk on gcp compute instance

List all disks

df -k

Create directory where disk will be mount

sudo mkdir -p /data

Find hard drive to mount

You'll find it in this directory, this kind of disk is oftently call sdb

namespace :figaro do
desc "SCP transfer figaro configuration to the shared folder"
task :setup do
on roles(:app) do
upload! "config/application.yml", "#{shared_path}/application.yml", via: :scp
end
end
desc "Symlink application.yml to the release path"
task :symlink do
@yannvery
yannvery / utf8_issues.md
Last active August 29, 2015 14:21
Capybara encountered some issues cause utf8

On a specific project I encountered some issues with encoding.

Capybara Launchy and html meta

When I used save_and_open_page the html page opens with bad encoding chars ( accent chars ).

To fix this I just add on my layout header this forgotten meta : <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

warning: regexp match /.../n against to UTF-8 string

During some tests I encountered this warning randomly due to faker data.

@yannvery
yannvery / new_rails_app.md
Created May 12, 2015 12:39
Create a rails app with a specific version

If you need to install a rails app with a specific rails version

rails _version_ new application_name

like

rails _4.1.10_ new rails_4_1_app

@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 / force_pull_branch.md
Created April 9, 2015 08:10
How to force git to pull a branch
# *branch is your branch
git fetch --all
git reset --hard origin/*branch
git pull origin *branch
````
@yannvery
yannvery / schema.xml
Created March 25, 2015 17:44
Default solr field type for lemming stemming
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<!-- analyseur configuré pour le français par Gaël -->
<!-- suppression d'éventuelles balises HTML-->
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<!-- découpage selon les espaces -->
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<!-- suppression de la ponctuation -->
<filter class="solr.PatternReplaceFilterFactory" pattern="^(\p{Punct}*)(.*?)(\p{Punct}*)$" replacement="$2"/>
<!-- suppression des tokens vides et des mots démesurés -->
@yannvery
yannvery / fixed_element_chrome.md
Last active August 29, 2015 14:17
Chrome issue when use position:fixed property on html element
@yannvery
yannvery / how_tu_pull_request.md
Last active August 29, 2015 14:17
How to pull request

#How to make a pull request

First steps

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Squashing