Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: Remove login autocomplete
* Description: Disable login password autocomplete
* Version: 0.1
* Author: Nobody
* License: WTFPL
*/
add_action('login_init', 'acme_autocomplete_login_init');
<?php
add_filter('wpbdp_form_field_html_value', 'alter_wpbdp_form_field_html_value', 10, 3);
function alter_wpbdp_form_field_html_value($value, $post_id, $class)
{
// add tel: to phone numbers
if($class->get_id() == 6) // the ID of the field to modify
{
$value = '<a href="tel:'.preg_replace('/[^0-9]/', '', $value).'">'.$value.'</a>';
}
@uzegonemad
uzegonemad / removing-related-youtube-videos-from-wordpress-oembeds.php
Last active August 29, 2015 14:18
Removing "Related YouTube Videos" From WordPress oEmbeds
@uzegonemad
uzegonemad / entrust-user-permission.md
Created March 12, 2015 22:15
Entrust Laravel 5 User Permissions

What is this?

Entrust is a fantastic role-based permission library for Laravel. However, by design, it only supports attaching permissions to roles, not to users.

This gist adds support for user-specific permissions on top of existing roles.

There's a chance that this hasn't been thought out fully, so use it at your own risk... I'm offering zero support for this. It either works, or it doesn't.

This has only been tested on Entrust's Laravel 5 branch.

How to use it

Process: CloudNotes [94119]
Path: /Applications/CloudNotes.app/Contents/MacOS/CloudNotes
Identifier: com.peterandlinda.CloudNotes
Version: 0.6.4 (9)
Code Type: X86-64 (Native)
Parent Process: launchd [296]
User ID: 501
Date/Time: 2014-03-18 22:38:31.761 -0500
OS Version: Mac OS X 10.8.5 (12F45)
@uzegonemad
uzegonemad / generate.py
Last active December 21, 2015 11:19
Generate Short URL... It's my first day in Python
from random import choice
from string import (ascii_letters, digits)
def generateLinkSlug(length = 6):
return "".join([choice(ascii_letters + digits) for x in xrange(length)])
print generateLinkSlug()