Skip to content

Instantly share code, notes, and snippets.

View mae829's full-sized avatar

Miguel A. Estrada mae829

View GitHub Profile
@jakebellacera
jakebellacera / ICS.php
Last active October 11, 2024 10:58
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@pwenzel
pwenzel / require_all_helper.php
Created August 23, 2012 17:07
Recursively include all PHP files
<?php
/**
* Scan the api path, recursively including all PHP files
*
* @param string $dir
* @param int $depth (optional)
*/
protected function _require_all($dir, $depth=0) {
if ($depth > $this->max_scan_depth) {
@takien
takien / youtubeID.js
Last active May 3, 2024 12:41
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@johnbillion
johnbillion / gist:5225514
Last active May 29, 2019 12:56
Post Meta Revisions
<?php
/*
Plugin Name: Post Meta Revisions
Description: Revisions for the 'foo' post meta field
Version: 1.0
Author: John Blackbourn
Plugin URI: http://lud.icro.us/post-meta-revisions-wordpress
*/
@windyjonas
windyjonas / wordpress-escaping.md
Last active September 21, 2020 16:10
Most of the escaping functions in WordPress, with a short explanation and example.

WordPress escaping functions

By: Jonas Nordström, @windyjonas
Date: 2013-04-16

esc_attr( $text );
Encodes the <, >, &, " and ' (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.
Example:

@natebot
natebot / is-meta-box-registered.php
Last active October 9, 2024 00:22
Test if a WordPress meta box has been registered.
<?php
/**
* Check if a meta box has been registered.
* Returns true if the supplied meta box id has been registered. false if not.
* Note that this does not check what page type
* @param String $meta_box_id An id for the meta box.
* @param String $post_type The post type the box is registered to (optional)
* @return mixed Returns boolean or a WP_Error if $wp_meta_boxes is not yet set.
*/
------ThisIsTheBoundary1234567890
Content-Disposition: form-data; name="source"; filename="image-vaun.png"
Content-Type: PNG
‰PNG

IHDRUS‰UŸ3 IDATx^Ô½w°e×uæ·_Î9õëÜ@£ÑÔH$€’‡’(SV©Tc‘TÉ,—ÿ»<å0v©,j¦J®r©ÆÖhä0Jòhþ°MٜQ %Š–(fBÌ ¡»N¯_Î9øû­µ÷9ûÞw_÷ë$A8}ï»áœ}ö^ûÛߊ»nGðwø¸ÙÅWW×CkksØÜÜ4µ©©ÁZËß«ë¡¥­5Ì/¯†æƦ°¼¼ž}ö›áâŋai~!üÜÏý\8qüˆ}¿.Þc}Õ½¦÷o¥ >õËgC_ogèïë
@jmcclellan
jmcclellan / wpseo_breadcrumb_links.php
Created September 28, 2014 01:18
Override Yoast SEO Breadcrumb Trail
@tankchintan
tankchintan / dfp-prestitial-ad.html
Created May 8, 2015 15:41
dfp > prestitial oop solution > markup shell
<link rel="stylesheet" href="/css/dfp/interstitial.css" />
<script src="/js/dfp/prestitial.js"></script>
<div id="prestitial-ad-outer-container">
<div id="prestitial-ad-overlay"></div>
<div id="prestitial-ad-close">Click to Skip Ad</div>
<div id="prestitial-ad-duration-counter"><em>Closing in...</em></div>
<div id="prestitial-ad-logo"></div>
<div id="prestitial-ad-container"></div>
<div id="prestitial-ad-third-party-content-view-tracker"></div>