Skip to content

Instantly share code, notes, and snippets.

@avebers
avebers / json_clean_decode.php
Created December 10, 2018 14:21
Clean comments of json content and decode it with json_decode(). Work like the original php json_decode() function with the same params. Support comments like /* */ and //
<?php
/**
* Clean comments of json content and decode it with json_decode().
* Work like the original php json_decode() function with the same params
*
* @param string $json The json string being decoded
* @param bool $assoc When TRUE, returned objects will be converted into associative arrays.
* @param integer $depth User specified recursion depth. (>=5.3)
* @param integer $options Bitmask of JSON decode options. (>=5.4)
* @return array/object
@avebers
avebers / func.php
Created November 19, 2018 16:26 — forked from ooooak/func.php
laravel bcrypt function
<?php
function bcrypt($password)
{
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 10]);
if ($hash === false)
{
throw new RuntimeException('Bcrypt hashing not supported.');
}
@avebers
avebers / gist:597e7cad4480180a572830ec92be0e3a
Created August 19, 2018 13:02 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@avebers
avebers / Template Freeswitch.xml
Created June 5, 2018 15:59 — forked from crashdump/Template Freeswitch.xml
Freeswitch - Zabbix Monitoring
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-12-04T16:01:36Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>