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
hr.android-style-text-input { | |
height: 10px; | |
border-color: #fff; | |
border-style: solid; | |
border-top-width: 0px; | |
} | |
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; |
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
<canvas id = "c" > </canvas> | |
<p> | |
Tear the cloth with your mouse.<br><br> | |
Right click and drag to cut the cloth.<br><br> | |
Reduce physics_accuracy if it's laggy, increase it for a better effect. | |
</p> |
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
/* | |
Copyright (c) 2011 Damien Antipa, http://www.nethead.at/, http://damien.antipa.at | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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
.container { | |
width: 400px; | |
height: 500px; | |
background: #234234; | |
display: table; | |
margin: 10px auto; | |
transform: rotate(90deg); | |
} | |
.container div { | |
border: 1px solid red; |
NewerOlder