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); |
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
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
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
( 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
/* | |
* 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
./frontend | |
│ | |
├── /coffee | |
│ ├── /models | |
│ | └── MyBaseModel.coffee | |
│ | └── MyModel.coffee | |
│ ├── /routers | |
│ | └── MyRouter.coffee | |
│ ├── /templates | |
| │ ├── /tmpl-dir1 |
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.registerMultiTask("cssindex", "Create an 'index' file of css @import rules for sitewide CSS", function() { | |
var file = grunt.file; | |
var target = this.target; | |
var fileHandles = this.data.map(function( glob ) { | |
return file.expand( glob ); | |
}); | |
var imports; | |
fileHandles = fileHandles.concat.apply( [], fileHandles ); |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
inline: { | |
'index.html': ['tpl/*.html'] | |
} | |
}); | |
grunt.registerMultiTask('inline', 'Inline AngularJS templates into single file.', function() { | |
var SCRIPT = '<script type="text/ng-template" id="<%= id %>"><%= content %></script>\n'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer