First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
<input> with attribute required
This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The :optional and :required CSS pseudo-classes will be applied to the field as appropriate.
How to show a spinner only when the required validations pass? (Without using any validation plugin, only the required attribute).
Form with a required input
= form_for @person, remote: true do |f|
= f.text_field, :first_name, required: true
Write function scramble(str1,str2) that returns true if a portion of str1 characters can be rearranged to match str2, otherwise returns false. | |
For example: | |
str1 is 'rkqodlw' and str2 is 'world' the output should return true. | |
str1 is 'cedewaraaossoqqyt' and str2 is 'codewars' should return true. | |
str1 is 'katas' and str2 is 'steak' should return false. | |
Only lower case letters will be used (a-z). No punctuation or digits will be included. | |
Performance needs to be considered |
// Use a closure to prevent the global namespace from be polluted. | |
(function() { | |
// Define StopIteration as part of the global scope if it | |
// isn't already defined. | |
if(typeof StopIteration == "undefined") { | |
StopIteration = new Error("StopIteration"); | |
} | |
// The original version of Array.prototype.forEach. | |
var oldForEach = Array.prototype.forEach; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>LPC</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="css/styles_bootstrap.css" type="text/css"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!--[if IE]> |
class Pet | |
attr_reader :color, :breed | |
attr_accessor :name | |
def initialize(color, breed) | |
@color = color | |
@breed = breed | |
@hungry = true | |
end | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Home</title> | |
<!-- Bootstrap core CSS --> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Home</title> | |
<!-- Bootstrap core CSS --> |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" type="text/css" href="css/normalize.css"> | |
<link rel="stylesheet" type="text/css" href="css/about_styles.css"> | |
<title>About</title> | |
<!--[if lt IE 9]> | |
<script src="dist/html5shiv.js"></script> |