Skip to content

Instantly share code, notes, and snippets.

Luján Fernaud lujanfernaud

Block or report user

Report or block lujanfernaud

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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')
@PurpleBooth
PurpleBooth / README-Template.md
Last active Oct 18, 2019
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@tbranyen
tbranyen / _usage.md
Last active Oct 14, 2019
OpenWeatherMap / Weather Icons integration
View _usage.md
  1. Include Weather Icons in your app: https://github.com/erikflowers/weather-icons

  2. Include the below JSON in your application, for example purposes, lets assume it's a global named weatherIcons.

  3. Make a request to OpenWeatherMap:

req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
@chucai
chucai / tracepoint_middleware.rb
Last active Oct 10, 2019 — forked from mattetti/tracepoint_middlware.rb
Rails: TracePoint rails request
View tracepoint_middleware.rb
# update application.rb
# config.middleware.insert_before(ActionDispatch::Static, TracePoint::Middleware)
class TracePoint
class Middleware
def initialize(app)
@app = app
end
def call(env)
@baweaver
baweaver / ruby_books.md
Last active Oct 9, 2019
A list of books for learning and expanding on your Ruby knowledge.
View ruby_books.md

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

The Well Grounded Rubyist

A good introduction to programming in general. Easy on newer programmers.

@shunchu
shunchu / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created Jul 25, 2012
Convert seconds into HH:MM:SS in Ruby
View convert-seconds-into-hh-mm-ss-in-ruby.rb
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active Oct 8, 2019
Simple Authentication in Rail 4 Using Bcrypt
View authentication_with_bcrypt_in_rails_4.md

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@aembleton
aembleton / docx2md.md
Last active Sep 24, 2019 — forked from vzvenyach/docx2md.md
Convert a Word Document into MD
View docx2md.md

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011
A demo of YAML anchors, references and nested values
View stooge_loader.rb
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@redrick
redrick / rspec_rails_cheetsheet.rb
Last active Aug 7, 2019 — forked from nerdinand/rspec_rails_cheetsheet.rb
New expect syntax + new hash syntax and couple corrections
View rspec_rails_cheetsheet.rb
#Model
expect(@user).to have(1).error_on(:username) # Checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
#Rendering
expect(response).to render_template(:index)
#Redirecting
expect(response).to redirect_to(movies_path)
You can’t perform that action at this time.