Skip to content

Instantly share code, notes, and snippets.

View jamesxv7's full-sized avatar
🔬
Researching

Jaime Olmo jamesxv7

🔬
Researching
View GitHub Profile
function findNextSquare(sq) {
// Optimal solution
// return Math.sqrt(sq)%1? -1 : Math.pow(Math.sqrt(sq)+1,2);
// Return the next square if sq if a perfect square, -1 otherwise
var curVal = Math.sqrt(sq) + 1
var nextSq = Math.sqrt(sq) + 1
nextSq *= nextSq
//console.log(sq)
//console.log(currentNumber)
@jamesxv7
jamesxv7 / stickyfooter.css
Created February 24, 2016 15:17
Sticky footer using CSS
* {
margin: 0;
}
html,
body {
height: 100%;
}
.wrapper {
@jamesxv7
jamesxv7 / index.html
Created February 24, 2016 13:49
HTML Template
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="stylesheet" href="css/normalize.min.css">
@jamesxv7
jamesxv7 / nice-gradient.css
Created February 12, 2016 15:42
Nice gradient using CSS
div {
height: 100px;
background-color: red;
background-image:
linear-gradient(
45deg,
#7BB9CF,
#848DD0,
#AC01CC,
#CD00A9,
@jamesxv7
jamesxv7 / fibonacci.js
Last active January 15, 2016 20:42
The Fibonacci Sequence
/**
* 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...
* The next number is found by adding up the two numbers before it.
* - The 2 is found by adding the two numbers before it (1+1)
* - Similarly, the 3 is found by adding the two numbers before it (1+2),
* - And the 5 is (2+3), and so on
*/
// Using recursion
function fibonacciNumberOf(number) {