This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* PROBLEM: Group an array of objects by a common key value. | |
* For example - Group cars by color. | |
* | |
* Following method also handle if the value is an array. | |
**/ | |
const groupBy = key => array => { | |
const addEle = (k, v, o) => o[k] = (o[k] || []).concat(v); | |
return array.reduce((output, obj) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log = function(str) { | |
var html = "<div class='.log'>" + str + "</div><br />"; | |
document.querySelector("body").innerHTML += html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toDOM = function() { | |
var element = document.createElement("div"), | |
fragment = document.createDocumentFragment(); | |
element.innerHTML=this; | |
fragment.appendChild(element.firstChild); | |
return fragment; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
/* Lists */ | |
$states: active inactive; | |
$tile-types: business home; | |
%active-text-color { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
/* Alias */ | |
$active-tile-background-color: #4C9CEA; | |
$inactive-tile-background-color: #FFF; | |
$active-text-color: #FFF; | |
$inactive-text-color: #000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Jasmine Spec Runner</title> | |
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.0.0/jasmine_favicon.png"> | |
<link rel="stylesheet" type="text/css" href="lib/jasmine-2.0.0/jasmine.css"> | |
<script type="text/javascript" src="lib/jquery.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
function defaultPreventer(handler) { | |
return function(event) { | |
alert("preventing default"); | |
event.preventDefault(); | |
handler.apply(this, arguments); | |
} | |
}; | |
function clickHandler(event) { | |
alert("Click Handler"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: green; | |
height: 1000px; | |
margin: 2px; | |
padding: 0px; | |
border: 1px solid red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
hr.android-style-text-input { | |
height: 10px; | |
border-color: #00FF00; | |
border-style: solid; | |
border-width: 2px; | |
border-top-width: 0px; | |
margin-top: -10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
hr.android-style-text-input { | |
height: 10px; | |
border-color: #00FF00; | |
border-style: solid; | |
border-width: 2px; | |
border-top-width: 0px; | |
margin-top: -10px; |
NewerOlder