// jQuery
$(document).ready(function() {
// code
})
I hereby claim:
- I am harmstyler on github.
- I am harmstyler (https://keybase.io/harmstyler) on keybase.
- I have a public key ASAHu5vyMaraw8XhU-rFa8YOZMvsUMAbSkQsTwsi0gbtJQo
To claim this, I am signing this object:
This handy piece of code allows you to create a full width/height div according to the viewport. The code also handles window resizing. Great for modal dialogs or popups.
// global vars
var winWidth = $(window).width();
var winHeight = $(window).height();
// set initial div height / width
$('div').css({
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
Array::equals = (array) -> | |
return false unless array | |
return false unless @length is array.length | |
i = 0 | |
while i < @length | |
if this[i] instanceof Array and array[i] instanceof Array | |
# Check and recurse into the nested arrays | |
return false unless this[i].equals(array[i]) | |
else if this[i] instanceof Object and array[i] instanceof Object | |
# Stringify objects for comparison |
Gist created from https://github.com/arturoherrero/command-line-one-liners
$ !!
$ sudo !!
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
import os | |
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) | |
BASE_DIR = os.path.abspath(os.path.join(PROJECT_DIR, '../../')) | |
# URL prefix for static files. | |
# Example: "http://example.com/static/", "http://static.example.com/" | |
STATIC_URL = '/static/' | |
# Additional locations of static files |
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
$alert.on('unaffixed.bs.affix', function () { | |
// ... Code Here | |
}); | |
$alert.on('affixed.bs.affix', function () { | |
// ... Code Here | |
}); |
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
$.fn.accessibleDropDown = -> | |
el = $(this); | |
enter = -> $(this).addClass('hover') | |
leave = -> $(this).removeClass('hover') | |
# Hover dropdown | |
$("li", el).hoverIntent(enter,leave) | |
# Make dropdown menus keyboard accessible | |
$("a", el).focus( -> | |
$(this).parents("li").addClass("hover"); |
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
/* ***** Carets and other CSS icons ***** */ | |
.caret { | |
&.up { | |
border-bottom: 4px solid #000000; | |
border-top: none; | |
} | |
&.left { | |
border-top: 4px solid transparent; | |
border-right: 5px solid #000000; | |
border-bottom: 4px solid transparent; |
NewerOlder