Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
nasrulhazim / quotes.json
Created May 14, 2017 08:23
Quotes List in JSON Format
{
"quotes": [
{
"quote":"Life isn’t about getting and having, it’s about giving and being.","author":"Kevin Kruse"},
{
"quote":"Whatever the mind of man can conceive and believe, it can achieve.","author":"Napoleon Hill"},
{
"quote":"Strive not to be a success, but rather to be of value.","author":"Albert Einstein"},
{
@bedeabza
bedeabza / hexhsl.php
Created April 11, 2014 12:10
PHP Hex to HSL and HSL to Hex conversion
function hexToHsl($hex) {
$hex = array($hex[0].$hex[1], $hex[2].$hex[3], $hex[4].$hex[5]);
$rgb = array_map(function($part) {
return hexdec($part) / 255;
}, $hex);
$max = max($rgb);
$min = min($rgb);
$l = ($max + $min) / 2;
@umidjons
umidjons / restfull-htaccess
Created February 20, 2014 05:14
Allow GET,POST,PUT,DELETE RESTful requests in .htaccess
<Limit GET POST PUT DELETE>
order deny,allow
allow from all
</Limit>
@jasny
jasny / linkify.php
Last active May 6, 2024 01:44
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())