Skip to content

Instantly share code, notes, and snippets.

@nathanallen
nathanallen / rails http status codes
Created August 15, 2016 00:44 — forked from seoyoochan/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@nathanallen
nathanallen / form-validator.js
Last active December 22, 2015 09:39 — forked from ksolo/form-validator.js
Form Validation
$(function(){
$('form').on('submit', function(e){
e.preventDefault();
$('#errors').empty();
//EMAIL VALIDATION
var email = $('input[name="email"]').val();
if (!(/.+/.test(email))){
$('#errors').append('<li>Insert an Email</li>');
}
<div id="die">
<% if @roll %>
<img src="/<%= @roll.value %>.png" title="<%= @roll.value %>" alt="the roll">
<% end %>
</div>
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the Socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
/*1. Use basic selectors (id, class, element) to choose an element on the page.
Use the .css() method to alter at least two CSS properties of this element. */