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
@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)
@baweaver
baweaver / ruby_books.md
Last active Oct 31, 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.

View capybara_cheat_sheet.md

Navigating

visit("/projects")
visit(post_comments_path(post))

Clicking links and buttons

@aembleton
aembleton / docx2md.md
Last active Oct 20, 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

@PurpleBooth
PurpleBooth / README-Template.md
Last active Nov 22, 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

View rspec3_config.md

Rails 4 with Rspec 3

Configure your Gemfile

# Gemfile
group :development, :test do
  gem 'rspec-rails', '~> 3.0.0'
  gem 'factory_girl_rails'
  gem 'capybara'
@tbranyen
tbranyen / _usage.md
Last active Nov 18, 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=?');
@lawrencejones
lawrencejones / agg.coffee
Last active Mar 15, 2019
Projection generator for mongodb
View agg.coffee
_ = require 'underscore'
# Given an array of elements ELEM and a matching KEY value,
# will build the apprpriate projection to generate sortable
# weights for a mongo aggregator.
#
# ELEM: An array of values upon which to match against KEY
# KEY: The document field key to match against
# I: Default 0, index into array at which to begin
#
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active Nov 22, 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

@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)
You can’t perform that action at this time.