Skip to content

Instantly share code, notes, and snippets.

View yannis's full-sized avatar

Yannis Jaquet yannis

View GitHub Profile
ruby_girls = ['Ellen', 'Nadia', 'Yannis', 'Romina']
p ruby_girls[1]
ruby_girls.sort.each do |ruby_girl|
puts ruby_girl
end
p 'let reverse it!'
ruby_girls.reverse.each do |ruby_girl|
puts ruby_girl
@yannis
yannis / tmux-cheatsheet.markdown
Created January 18, 2016 07:25 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
require 'minitest/autorun'
require_relative 'school'
class SchoolTest < MiniTest::Unit::TestCase
def school
@school
end
def setup
require "gimli"
require "yaml"
ROOT_PATH = "~/Documents/ember_guides/"
TABLE_OF_CONTENT_PATH = ROOT_PATH+"website/data/guides.yml"
GUIDE_FILES_PATH = ROOT_PATH+"website/source/guides/"
def concatenated_path
yaml_table_of_content = YAML.load_file TABLE_OF_CONTENT_PATH
concatenated_paths = []
@yannis
yannis / select2_steps.rb
Last active July 21, 2016 12:39
Chose an option from a select2.js dropdown menu in cucumber
When /^I chose "(.*?)" in the "(.*?)" select2 menu$/ do |value, placeholder|
container = page.find('.select2-container', text: placeholder)
container.find('a.select2-choice').click
input = container.find("input[type='text']")
input.set(value)
sleep 1
li = container.find('li', text: value)
li.click
end
@yannis
yannis / tUnit2Rspec
Created October 19, 2012 07:47
Test::Unit to Rspec conversion ruby script
require "highline/import"
from_path = ask "Enter path for file to convert: "
to_path = ask "Enter the path where to save the spec file: "
unless File.exists? from_path
puts "Sorry this file doesn't exist!: #{from_path}"
puts "Please try again"
return
end
t_unit = File.read(from_path).to_s
@yannis
yannis / nginx.conf
Created January 26, 2012 15:26 — forked from sax/nginx.conf
unicorn + nginx on launchd
user sax staff;
worker_processes 1;
daemon off;
error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
pid /var/run/nginx.pid;
@yannis
yannis / nginx_rails_3_1
Created January 24, 2012 20:31 — forked from shapeshed/nginx_rails_3_1
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {