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
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
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
_ |
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
if (!('contains' in String.prototype)) { | |
String.prototype.contains = function(str, startIndex) { | |
return ''.indexOf.call(this, str, startIndex) !== -1; | |
}; | |
} |
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
var n = 123 | |
String("00000" + n).slice(-5); // returns 00123 | |
("00000" + n).slice(-5); // returns 00123 | |
(" " + n).slice(-5); |
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
function randomDate(start, end) { | |
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); | |
} | |
randomDate(new Date(2012, 0, 1), new Date()); |
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
function getRandomInt (min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
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
Math.random().toString(36).slice(2,7); |
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
<div class="image"> | |
<img src="xy.jpg" alt="" /> | |
<img class="hoverimage" src="xy_hover.jpg" alt="" /> | |
</div> | |
CSS: | |
.image { position: relative; width: 184px; height: 219px; } | |
.hoverimage { position: absolute; top: 0; left: 0; display: none; } | |
.image:hover .hoverimage { display: block; } |
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
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>(); | |
ResultSetMetaData metaData = resultSet.getMetaData(); | |
int columnCount = metaData.getColumnCount(); | |
while (resultSet.next()) { | |
Map<String, Object> columns = new LinkedHashMap<String, Object>(); | |
for (int i = 1; i <= columnCount; i++) { | |
columns.put(metaData.getColumnLabel(i), resultSet.getObject(i)); | |
} |
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
Unchecked | |
ArrayIndexOutOfBoundsException | |
ClassCastException | |
IllegalArgumentException | |
IllegalStateException | |
NullPointerException | |
NumberFormatException | |
AssertionError | |
ExceptionInInitializerError | |
StackOverflowError |
NewerOlder