Skip to content

Instantly share code, notes, and snippets.

View mralessio's full-sized avatar

ALP mralessio

View GitHub Profile
@mralessio
mralessio / connectHTMLelements_SVG.png
Created September 29, 2024 12:54 — forked from alojzije/connectHTMLelements_SVG.png
Connect two elements / draw a path between two elements with SVG path (using jQuery)
connectHTMLelements_SVG.png
@mralessio
mralessio / meta-tags.md
Created September 16, 2017 13:45 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@mralessio
mralessio / index.html
Last active August 15, 2018 08:23
Starter template Bootstrap 4
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css">
@mralessio
mralessio / GitHub-Forking.md
Created April 22, 2017 16:21 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@mralessio
mralessio / wp-plugin-security-testing-cheatsheet.md
Created March 2, 2017 20:28 — forked from bueltge/wp-plugin-security-testing-cheatsheet.md
WordPress Plugin Security Testing Cheat Sheet

WordPress Plugin Security Testing Cheat Sheet

This cheat sheet was compiled by Dewhurst Security to record the knowledge gained when testing WordPress plugins for security issues for our clients. The security documentation provided by WordPress and found online for plugin security is sparse, outdated or unclear. This cheat sheet is intended for Penetration Testers who audit WordPress plugins or developers who wish to audit their own WordPress plugins.

This is a living document, feedback in the form of Issues or Pull Requests is very much welcomed.

Cross-Site Scripting (XSS)

@mralessio
mralessio / file.php
Created January 20, 2017 11:20
Ways of how to check if ajax defined from beckend and frontend
<?php
// native WP 4.7
// Determines whether the current request is a WordPress Ajax request.
wp_doing_ajax();
// Shortcake UI doing ajax
// @link: https://github.com/wp-shortcake/shortcake/issues/407
define('SHORTCODE_UI_DOING_PREVIEW');
// Check if it is frontend ajax
@mralessio
mralessio / url_slug.php
Created September 21, 2016 14:17 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <[email protected]>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@mralessio
mralessio / functions.php
Created September 20, 2016 22:38
WP: Change the active tab to *Upload Files* when inserting media
<?php
// ==============================================
// Change the active tab to "Upload Files" when inserting media
// ==============================================
function wp_media_default_tab() {
?>
<script type="text/javascript">
jQuery(document).ready(function($){ wp.media.controller.Library.prototype.defaults.contentUserSetting=false; });
</script>
@mralessio
mralessio / functions.php
Created September 20, 2016 22:31
WP Disable library tab in media uploader (not tested)
function remove_medialibrary_tab($tabs) {
if ( !current_user_can( 'administrator' ) ) {
unset($tabs["mediaLibraryTitle"]);
}
return $tabs;
}
add_filter('media_view_strings', 'remove_medialibrary_tab');
@mralessio
mralessio / wp-media-playground.js
Created September 20, 2016 22:27 — forked from dnaber-de/wp-media-playground.js
Play around with the wp.media API
myGlobalFrame = null;
/**
* @param wp wp namespace
* @param Backbone
* @param $ jQuery
*/
;( function( wp, Backbone, $ ) {
'use strict';
var myLibrary = wp.media.controller.FeaturedImage.extend(