Skip to content

Instantly share code, notes, and snippets.

View nxvhm's full-sized avatar
🍒

Antoan Partadzhiev nxvhm

🍒
  • Plovdiv, Bulgaria
View GitHub Profile
@nxvhm
nxvhm / HttpRequest.php
Created August 3, 2018 09:52
class for Http Requests
<?php
require_once('HttpResponse.php');
class HttpRequest {
/**
* The url which will be requested
* @var string
*/
@nxvhm
nxvhm / contenxt.html
Last active April 10, 2018 18:03
macros-extra-contents
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="macro-1">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
{{extra_contents}}
@nxvhm
nxvhm / ContextParser.php
Created February 12, 2018 05:52
Handlebars php parser
<?php
// uncomment the following two lines, if you don't use composer
require 'vendor/handlebars.php-0.10.4/src/Handlebars/Autoloader.php';
// require 'vendor/handlebars.php-master/src/Handlebars/Autoloader.php';
Handlebars\Autoloader::register();
use Handlebars\Handlebars;
@nxvhm
nxvhm / Utils.php
Last active June 12, 2017 09:37
openssl functions(encrypt, decrypt, random string)
<?php
namespace Utils;
use Config;
class SecurityUtils {
/**
* @param string $string: string to encrypt or decrypt
@nxvhm
nxvhm / Hasher.php
Created January 30, 2015 18:03
Password Hash
<?php
class Hasher
{
private static $_pepper = 'Bh7ly%NX*3OY12%zd50amb$bizad%pxln*3a5q';
/**
* @param plain pass | string generated from bcrypt_salt() method
* @return string
*/
@nxvhm
nxvhm / main.js
Created December 10, 2014 10:10
Stream data with php
<script>
try {
var source = new EventSource('/stream');
source.addEventListener('tick', function ( evt ) {
console.log(evt.data);
});
}
catch ( e ) {