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
/* Directive for Hitting Enter for Search */ | |
function ngEnter() { | |
return function (scope, element, attrs) { | |
element.bind("keydown keypress", function (event) { | |
if (event.which === 13) { | |
scope.$apply(function () { | |
scope.$eval(attrs.ngEnter); | |
}); | |
event.preventDefault(); | |
} |
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
<html> | |
<head> | |
<title>Convert Time from Argentine Time to Local Time</title> | |
</head> | |
<body> | |
<span id="time"></span> | |
<script> | |
function toLocalTime(time) { | |
var splitTime = time.split(':'); | |
var currDate = 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
var startD = new Date("April 7, 2015")/3600; | |
var currD = new Date()/3600; | |
var diffD = Math.abs(currD - startD); | |
var time = Math.ceil(diffD)+10000; | |
var clock = $('.flip-counter').FlipClock(time, { | |
clockFace: 'Counter' | |
}); | |
setTimeout(function() { |
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
$('body :not(script,sup)').contents().filter(function() { | |
return this.nodeType === 3; | |
}).replaceWith(function() { | |
return this.nodeValue.replace(/[™®©]/g, '$&'); | |
}); |
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 myArr = [], | |
count = 0, | |
batches = 0, | |
newArr = []; | |
for (var i = 0; i < 103; i++) { | |
myArr.push(i); | |
if (myArr.length > 9) { | |
batches = Math.ceil(myArr.length / 10); | |
} |
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
... | |
/** | |
** Disables RSS for staging | |
**/ | |
function disable_rss() { | |
return null; | |
} | |
if($_SERVER["HTTP_HOST"] == "[staging server address]"){ | |
add_filter('default_feed', 'disable_rss'); | |
} |
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.prototype.findDupes = function () { | |
return this.reduce(function (accum, current) { | |
if (angular.lowercase(accum).indexOf( | |
angular.lowercase(current)) < 0) { | |
accum.push(angular.lowercase(current)); | |
} | |
return accum; | |
}, []); | |
}; |
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
@mixin center-justified { | |
text-align-last: center; | |
text-align: justify; | |
} | |
@mixin left-justified { | |
text-align-last: left; | |
text-align: justify; | |
} | |
@mixin right-justified { | |
text-align-last: right; |
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
$("*").each(function() { | |
if ($(this).width() > $(window).width()) { | |
console.log(this); | |
} | |
}); |
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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
OlderNewer