This file contains hidden or 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
// default values | |
$.fn.repeater.defaults = { | |
groupClass: 'r-group', | |
btnAddClass: 'r-btnAdd', | |
btnRemoveClass: 'r-btnRemove', | |
minItems: 1, | |
maxItems: 0, | |
startingIndex: 0, | |
reindexOnDelete: true, | |
repeatMode: 'insertAfterLast', // append, prepend, insertAfterLast |
This file contains hidden or 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
/** | |
* Default config values. Can be overridden globally. | |
* | |
* maxLength [int] - The maximum length of the input, textarea, or editable field | |
* countWords [bool] - Whether to count by word or by length | |
* countContainer [jQuery element | DOM selector string] - The container to display the count and message | |
* countDown [bool] - Whether the counter displays a remaining count or current count | |
* errorClass [string] - The class to apply to countContainer when an overage occurs | |
* countWordStr [string] - The string to use after the word length | |
* countLengthStr [string] - The string to use after the length |
This file contains hidden or 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
// default lightbox options | |
$.fn.lightweight.defaults = { | |
height: 260, | |
width: 380, | |
color: '#fff', | |
bgColor: '#000', | |
bgOpacity: .5, | |
overlayColor: '#000', | |
overlayOpacity: .8, | |
fadeSpeed: 400, |
This file contains hidden or 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
// open the target element with ID "targetElement" (assumes it's already hidden by end user via style="display:none") | |
$('#targetElement').lightweight({ | |
height: 400, | |
width: 400 | |
}); | |
// to manually close the lightbox | |
$('#targetElement').lightweight('close'); | |
// an example of binding a button to close the lightbox |
This file contains hidden or 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 | |
# MySQL database defaults | |
dbname="wordpress" | |
dbuser="wordpress" | |
# Gather user info | |
read -r -p "Enter your domain, e.g. mywebsite.co (no http://, no www.): " wpURL | |
read -r -p "Enter a secure MySQL root password to use (save this somewhere): " rootpass | |
read -r -p "Enter a secure MySQL WordPress password to use: " userpass |
This file contains hidden or 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 | |
# one liner to get all Pingdom probe server IP addresses | |
wget --quiet -O- https://www.pingdom.com/rss/probe_servers.xml | perl -nle 'print $1 if /IP: (([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5]));/' |
This file contains hidden or 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
<?php | |
/** | |
* Handle calculating a percentage/fraction (proration) we should charge the | |
* user for based on the current day of the month before their next bill cycle. | |
* To use yourself, implement a getSubscription method which returns an object | |
* containing current_period_start and current_period_end DateTime objects. | |
* | |
* @access public | |
* @return float |
This file contains hidden or 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 | |
##################################################### | |
# To run, simply: chmod +x medusa.sh && ./medusa.sh # | |
##################################################### | |
# Successful publickey connections | |
echo '==== Successful SSH Public Key Connections ====' | |
CONNECTIONS=`grep "sshd.*Accepted publickey" /var/log/auth.log` | |
while read -r line; do |
This file contains hidden or 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
$.ajaxSetup({ | |
dataFilter: function(data, type) { | |
var prefixes = ['//', 'while(true);', 'for(;;);'], | |
i, | |
l,, | |
pos; | |
if (type != 'json' && type != 'jsonp') { | |
return data; | |
} |
This file contains hidden or 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
/* the DIV container */ | |
#salid_wrapper { } | |
/* the anchor link to close the lightbox */ | |
#salid_wrapper #salid_close { } | |
#salid_wrapper #salid_close:hover { } | |
/* the content block containing the unordered list of errors */ | |
#salid_wrapper .salid_content { } |