Skip to content

Instantly share code, notes, and snippets.

View melanyss's full-sized avatar
🏠
Working from home

Melanys melanyss

🏠
Working from home
View GitHub Profile
@melanyss
melanyss / Jquery Ajax
Created November 21, 2020 16:21 — forked from JonnyNineToes/Jquery Ajax
Quick template for Jquery Ajax calls
// submit is an action performed ON THE FORM ITSELF...
// probably best to give the form an ID attribute and refer to it by that
$('form').submit( function (event) {
// prevent the usual form submission behaviour; the "action" attribute of the form
event.preventDefault();
// validation goes below...
// now for the big event
$.ajax({
// the server script you want to send your data to
@melanyss
melanyss / jquery.snippets.js
Created November 16, 2020 11:43 — forked from avireni/jquery.snippets.js
Jquery + JS snippets
Check if and which key was pressed
$(function() {
$(document).keypress(function(e){
switch(e.which){
// "ENTER"
case 13:
alert('enter pressed');
break;
// "s"
@melanyss
melanyss / .htaccess
Created June 4, 2020 04:07 — forked from jennimckinnon/.htaccess
Restrict Direct Access to Plugin and Theme PHP files in WordPress. Source: https://www.acunetix.com/websitesecurity/wordpress-security-top-tips-secure-wordpress-application/
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/
RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L]
RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php
RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/
RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L]
@melanyss
melanyss / compatibility.js
Created June 4, 2020 00:19 — forked from danielpataki/compatibility.js
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
@melanyss
melanyss / media-query.css
Created May 28, 2020 23:45 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@melanyss
melanyss / fadein.html
Created May 27, 2020 17:48 — forked from jasonmelgoza/fadein.html
Images fade in onload
<!DOCTYPE HTML>
<html>
<head>
<title>FadingIN</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
window.onload = function() {$('.fade_img').hide().fadeIn(1000);};
});
@melanyss
melanyss / functions.php
Created May 24, 2020 20:22 — forked from zachbrowne/functions.php
WordPress functions.php Additions
<?php // custom functions.php template @ digwp.com
// add feed links to header
if (function_exists('automatic_feed_links')) {
automatic_feed_links();
} else {
return;
}
@melanyss
melanyss / nav.html
Created May 19, 2020 12:52 — forked from Techgokul/nav.html
Navigation bar Using HTML5,CSS
<html>
<head>
<title>Navigation bar</title>
<link rel="stylesheet" href="style.css"/>
<meta charset="utf-8">
</head>
<body>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
@melanyss
melanyss / like&dislike.html
Created May 19, 2020 12:52 — forked from Techgokul/like&dislike.html
Create a Like and Dislike Button using html,css and js
<html>
<head>
<title>Like and Dislike</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<style>
.fa{
font-size: 300px;
color: white;