Skip to content

Instantly share code, notes, and snippets.

View Mario-Duarte's full-sized avatar
:shipit:
Starting a new position

Mario Duarte Mario-Duarte

:shipit:
Starting a new position
View GitHub Profile
@Mario-Duarte
Mario-Duarte / share-urls.md
Created March 30, 2020 15:31 — forked from apisandipas/share-urls.md
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@Mario-Duarte
Mario-Duarte / colliding.js
Created July 21, 2019 22:07 — forked from jtsternberg/colliding.js
Detect if two elements are colliding/overlapping
/**
* Detects if two elements are colliding
*
* Credit goes to BC on Stack Overflow, cleaned up a little bit
*
* @link http://stackoverflow.com/questions/5419134/how-to-detect-if-two-divs-touch-with-jquery
* @param $div1
* @param $div2
* @returns {boolean}
*/
@Mario-Duarte
Mario-Duarte / search_for_value.php
Created January 8, 2019 17:11 — forked from kjbrum/search_for_value.php
Check if a value exists in an array/object.
<?php
/**
* Check if an array is a multidimensional array.
*
* @param array $arr The array to check
* @return boolean Whether the the array is a multidimensional array or not
*/
function is_multi_array( $x ) {
if( count( array_filter( $x,'is_array' ) ) > 0 ) return true;
return false;
@Mario-Duarte
Mario-Duarte / request_no_curl.php
Created June 29, 2018 16:43 — forked from iNaD/request_no_curl.php
Sending a GET/POST Request via PHP without CURL (fopen needs to be enabled)
<?php
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
@Mario-Duarte
Mario-Duarte / custom_wp_gallery
Last active October 6, 2016 12:31 — forked from carlesjove/custom_wp_gallery
Custom gallery markup for WordPress. Put this un functions.php and it will override the default shortcode. [Edited version from original]