Skip to content

Instantly share code, notes, and snippets.

Avatar

Rodolfo Buaiz brasofilo

View GitHub Profile
View _Stay_standalone.md

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

View repeatable-fields.php
<?php
add_action('admin_init', 'add_meta_boxes', 1);
function add_meta_boxes() {
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high');
}
function repeatable_meta_box_display() {
global $post;
@brasofilo
brasofilo / APPLE_SE_99753.xml
Created Aug 25, 2014
Codex function reference to Apple Dictionary
View APPLE_SE_99753.xml
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
<d:entry id="get_usernumposts" d:title="get usernumposts">
<d:index d:value="get usernumposts"/>
<h1>get usernumposts</h1>
<p>{{Deprecated}}
== Description ==
View jGfeed.js
/*
* jGFeed 1.0 - Google Feed API abstraction plugin for jQuery
*
* Copyright (c) 2009 jQuery HowTo
*
* Licensed under the GPL license:
* http://www.gnu.org/licenses/gpl.html
*
* URL:
* http://jquery-howto.blogspot.com
View gist:a79aedb18fb55510ab4d
<?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
*/
@brasofilo
brasofilo / jsfiddle-revisions.js
Created Sep 12, 2014
UserScript to show JSFiddle revisions for each fiddle
View jsfiddle-revisions.js
// ==UserScript==
// @name Show JSFiddle revisions for each fiddle
// @namespace webapps.se
// @author brasofilo
// @include http://jsfiddle.net/user/*
// @description Add revision history
// @require //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
// ==/UserScript==
/* Stores the API list result */
View jquery.vmap.world.js
/** Add World Map Data Points */
var my_map_data = {
"id": {
"path": "M781.68,324.4l-2.31,8.68l-12.53,4.23l-3.75-4.4l-1.82,0.5l3.4,13.12l5.09,0.57l6.79,2.57v2.57l3.11-0.57l4.53-6.27v-5.13l2.55-5.13l2.83,0.57l-3.4-7.13l-0.52-4.59L781.68,324.4L781.68,324.4M722.48,317.57l-0.28,2.28l6.79,11.41h1.98l14.15,23.67l5.66,0.57l2.83-8.27l-4.53-2.85l-0.85-4.56L722.48,317.57L722.48,317.57M789.53,349.11l2.26,2.77l-1.47,4.16v0.79h3.34l1.18-10.4l1.08,0.3l1.96,9.5l1.87,0.5l1.77-4.06l-1.77-6.14l-1.47-2.67l4.62-3.37l-1.08-1.49l-4.42,2.87h-1.18l-2.16-3.17l0.69-1.39l3.64-1.78l5.5,1.68l1.67-0.1l4.13-3.86l-1.67-1.68l-3.83,2.97h-2.46l-3.73-1.78l-2.65,0.1l-2.95,4.75l-1.87,8.22L789.53,349.11L789.53,349.11M814.19,330.5l-1.87,4.55l2.95,3.86h0.98l1.28-2.57l0.69-0.89l-1.28-1.39l-1.87-0.69L814.19,330.5L814.19,330.5M819.99,345.45l-4.03,0.89l-1.18,1.29l0.98,1.68l2.65-0.99l1.67-0.99l2.46,1.98l1.08-0.89l-1.96-2.38L819.99,345.45L819.99,345.45M753.17,358.32l-2.75,1.88l0.59,1.58l8.75,1.98l4.42,0.79l1.87,1.98l5.01,0.4l2.
@brasofilo
brasofilo / manipulate-jsfiddle-page.md
Last active Aug 29, 2015
Show JSFiddle revisions for each fiddle v2
View manipulate-jsfiddle-page.md
// ==UserScript==
// @name           Show JSFiddle revisions for each fiddle v2
// @namespace      webapps.se
// @author 		   brasofilo
// @include        http://jsfiddle.net/user/*
// @description    Add revision history.
// ==/UserScript==

/* Stores the API list result */
@brasofilo
brasofilo / gist:3302470
Created Aug 9, 2012
5G Blacklist 2012 - Adapted to work with WordPress
View gist:3302470
# 5G BLACKLIST/FIREWALL
# @ http://perishablepress.com/5g-blacklist/
# 5G:[QUERY STRINGS]
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (localhost|mosconfig|scanner) [NC,OR]
# RewriteCond %{QUERY_STRING} (environ|localhost|mosconfig|scanner) [NC,OR]
# too many pieces of legitimate content with the word "environment" in the URL
@brasofilo
brasofilo / so_13646200.php
Created Dec 11, 2012
Repeatable upload field
View so_13646200.php
add_action('admin_init', 'so_13646200_add_post_gallery');
add_action('save_post' , 'so_13646200_update_post_gallery');
function so_13646200_add_post_gallery() {
add_meta_box(
'post_gallery',
'Clients Logo Options',
'so_13646200_post_gallery_options',
'post',
'normal',
You can’t perform that action at this time.