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
/* | |
* Grunt Task File | |
* --------------- | |
* | |
* Task: coffee | |
* Description: Compile CoffeeScript files | |
* Dependencies: coffee-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
( window.webkitNotifications.createNotification('message.png', 'Привет Хабр!', 'Получили нотис. Трололо...') ).show(); | |
// http://habrahabr.ru/post/155039/ |
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
jQuery.fn.valignMiddle = function(elem) { | |
var h = jQuery(this).height(); | |
var h2 = jQuery(this).parent().height(); | |
var pad = (h2-h)/2; | |
jQuery(this).css("padding-top", pad); | |
jQuery(this).css("padding-bottom", pad); | |
} |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
// Originally solved by Tim Branyen in his drop file plugin | |
// http://dev.aboutnerd.com/jQuery.dropFile/jquery.dropFile.js | |
jQuery.event.props.push('dataTransfer'); |
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
/* Button */ | |
button, input[type="submit"] { | |
display: inline-block; | |
padding: 2px 20px; | |
background: #c4c4c4; | |
background: -webkit-linear-gradient(top, #eee, #c4c4c4); | |
background: -moz-linear-gradient(top, #eee, #c4c4c4); | |
background: -ms-linear-gradient(top, #eee, #c4c4c4); | |
background: -o-linear-gradient(top, #eee, #c4c4c4); | |
background: linear-gradient(top, #eee, #c4c4c4); |
NewerOlder