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
google.maps.event.addListener(infowindow, 'domready', function() { | |
$(".schedulelunch").click(function(e) { | |
setCommunitySelected(e.currentTarget.dataset.communitynumber); | |
}); | |
}); |
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
// highlight active menu item | |
var url = window.location; | |
$('ul.nav a').filter(function() { | |
return this.href == url; | |
}).parent().addClass('active'); | |
// alternative for use with specific parameter checking | |
var url = window.location; | |
$('ul.nav a').filter(function() { | |
locationLink = getURLParameter('calID',url); |
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
el[0].getElementsByTagNameNS('http://purl.org/rss/1.0/modules/slash/', 'comments')[0].innerHTML; | |
// or a fuller example | |
$.get('/blogfeed.php', function (data) { | |
var count = 1; | |
$(data).find("item").each(function () { | |
var el = $(this); | |
// ... | |
// how many comments |
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
fail2ban-client status | |
fail2ban-client set ssh-iptables unbanip x.x.x.x |
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
// gMarkers is your array of markers | |
var bounds = new google.maps.LatLngBounds(); | |
for(i=0;i<gMarkers.length;i++) { | |
bounds.extend(gMarkers[i].getPosition()); | |
} | |
map.fitBounds(bounds); |
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
find . -type d -perm 777 -exec chmod 755 {} \; # (for changing the directory permission) | |
find . -type f -perm 777 -exec chmod 644 {} \; # (for changing the file permission) | |
# If they did not have 777 permissions, we easily remove the -perm 777 part. | |
# sourced from: http://serverfault.com/a/363428 |
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
perl -pi -e 's/you/me/g' file | |
# works with *html or any extension to do all in current directory |
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
<@elyograg> remember this sentence: collections are made up of shards. shards are made up of replicas. each replica is a core. |
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
// as seen here: http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily | |
// left: 37, up: 38, right: 39, down: 40, | |
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
var keys = {37: 1, 38: 1, 39: 1, 40: 1}; | |
function preventDefault(e) { | |
e = e || window.event; | |
if (e.preventDefault) |