Skip to content

Instantly share code, notes, and snippets.

View new_slugify.php
function slugify($string) {
$string = transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();", $string);
$string = preg_replace('/[-\s]+/', '-', $string);
return trim($string, '-');
echo slugify("Я люблю PHP!");
reeslo / jsCookies.js
Created Dec 14, 2017 — forked from jrivero/jsCookies.js
Pure Javascript Cookies Management
View jsCookies.js
// found on
// create my jsCookies function
var jsCookies = {
// this gets a cookie and returns the cookies value, if no cookies it returns blank ""
get: function(c_name) {
if (document.cookie.length > 0) {
var c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
reeslo / wp-chosen-tax-metabox.php
Created Dec 13, 2017 — forked from helen/wp-chosen-tax-metabox.php
Use Chosen for a replacement WordPress taxonomy metabox
View wp-chosen-tax-metabox.php
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to
reeslo / 01_Laravel 5 Simple ACL
Last active Aug 31, 2015 — forked from amochohan/01_Laravel 5 Simple ACL
Laravel 5 Simple ACL - Protect routes by an account / role type
View 01_Laravel 5 Simple ACL

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.


Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

reeslo / gist:dd2758d66e1036ce28ca
Last active Aug 29, 2015 — forked from plasticbrain/gist:3887245
PHP: mime types (array format)
View gist:dd2758d66e1036ce28ca
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/',
'.acgi' => 'text/html',