Skip to content

Instantly share code, notes, and snippets.

View GioRosso's full-sized avatar

Rusmir Gadžo GioRosso

View GitHub Profile
@GioRosso
GioRosso / authentication_with_bcrypt_in_rails_4.md
Created September 19, 2016 19:53 — forked from thebucknerlife/authentication_with_bcrypt_in_rails_4.md
Simple Authentication in Rail 4 Using Bcrypt

#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

<div class="form-group">
<%= unos.label "Početak (HH:MM)" %>
<%= unos.text_field :begintime, class: 'form-control', value: Time.now.strftime('%H:%M') %>
</div>
<div class="form-group">
<%= unos.label "Kraj (HH:MM)" %>
<%= unos.text_field :endtime, class: 'form-control' %>
</div>
<script>
@GioRosso
GioRosso / jQuery: Change properties on scroll position
Created August 26, 2016 19:33
On fixed position, change CSS and visibility of a DIV
<script type="text/javascript">
$(window).scroll(function() {
if ($(this).scrollTop()>850){
$("#bio-title").fadeOut();
$("#bio-facts").css( "height", "450" );
} else {
$("#bio-title").fadeIn();
$("#bio-facts").css( "height", "200" );
}
});