Skip to content

Instantly share code, notes, and snippets.

View Bujhm's full-sized avatar
🐢
I may be slow to respond.

Igor Bujhm

🐢
I may be slow to respond.
View GitHub Profile
@Bujhm
Bujhm / jquery.email-antispam.js
Created February 15, 2018 15:00 — forked from mathiasbynens/jquery.email-antispam.js
Simple spam protection for email addresses using jQuery
/* Simple spam protection for email addresses using jQuery.
* Well, the protection isn’t jQuery-based, but you get the idea.
* This snippet allows you to slightly ‘obfuscate’ email addresses to make it harder for spambots to harvest them, while still offering a readable address to your visitors.
* E.g.
* <a href="mailto:foo(at)example(dot)com">foo at example dot com</a>
* →
* <a href="mailto:[email protected]">[email protected]</a>
*/
$(function() {
@Bujhm
Bujhm / header_http_status_codes.php
Created April 10, 2018 15:30 — forked from phoenixg/header_http_status_codes.php
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@Bujhm
Bujhm / http_response_code.php
Created April 10, 2018 15:34 — forked from inxilpro/http_response_code.php
Polyfill for PHP 5.4's http_response_code() function.
<?php
if (!function_exists('http_response_code')) {
function http_response_code($code = null)
{
static $defaultCode = 200;
if (null != $code) {
switch ($code) {
case 100: $text = 'Continue'; break; // RFC2616
@Bujhm
Bujhm / organization.wsdl
Last active April 17, 2018 07:25 — forked from umidjons/organization.wsdl
SOAP server/client example in WSDL mode
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Organization"
targetNamespace="urn:Organization"
xmlns:tns="urn:Organization"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
@Bujhm
Bujhm / exceptions-tree.php
Created January 22, 2020 04:58 — forked from mlocati/exceptions-tree.php
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@Bujhm
Bujhm / docker-compose.yml
Created March 2, 2020 15:24 — forked from brunosimioni/docker-compose.yml
Docker Compose to Prometheus, PushGateway and Grafana setup
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}
@Bujhm
Bujhm / ImageProvider.php
Created May 18, 2020 20:56 — forked from kunicmarko20/ImageProvider.php
Sonata Media SVG Provider
<?php
namespace YourBundle\Provider;
use Sonata\MediaBundle\Provider\FileProvider;
class ImageProvider extends FileProvider
{
}
@Bujhm
Bujhm / docker-cleanup-resources.md
Created August 6, 2020 11:53 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@Bujhm
Bujhm / Readme.md
Created August 20, 2020 20:28 — forked from kunicmarko20/Readme.md
Sonata Admin Custom Page

Sonata Admin Custom Page

This example will help you create custom Sonata Admin page and also explain how to make a statistics admin.

You can read more here

@Bujhm
Bujhm / tokens.md
Created September 9, 2020 19:56 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов