Skip to content

Instantly share code, notes, and snippets.

View sammyaxe's full-sized avatar

Sam Axe sammyaxe

View GitHub Profile
echo something
$('#alt_example_4').datetimepicker({
altField: "#alt_example_4_alt",
altFieldTimeOnly: false,
dateFormat: 'yy-mm-dd',
timeFormat: 'hh:mm tt',
stepMinute:10,
minDateTime:nd,
showButtonPanel: false,
controlType: 'slider'
});
eventEmitter.on('_panmove', function (e) {
var x = lastTranslate.x + e.deltaX,
y = lastTranslate.y + e.deltaY,
r = config.rotation(x, y, targetElement, config.maxRotation);
if(e.deltaX > 150 || e.deltaX < -150 ) card.throwOut(x, y);
config.transform(targetElement, x, y, r);
eventEmitter.trigger('dragmove', {
@media (max-width: 480px) {
.g-recaptcha > div > div {
width:inherit !important;
position:relative;
display:block;
padding:0;
overflow:hidden;
max-width:302px;
border-right:1px solid #d3d3d3;
border-radius:4px;
@media screen and (max-height: 575px){
#rc-imageselect, .g-recaptcha {transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;}
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
function myFunction(){
echo 'My Ajax Response';
exit; //must include exit othervise it will print out 0
}
add_action('wp_ajax_my_action', 'myFunction'); // for logged in user
add_action('wp_ajax_nopriv_my_action', 'myFunction'); // if user not logged in
$.ajax({
url: "/wp-admin/admin-ajax.php",
type:'POST',
data: {action:'my_action'},
beforeSend: function(){
},
success: function(data){
//data would contain string that was echoed in the myFunction
@import 'https://fonts.googleapis.com/css?family=Petit+Formal+Script';