Skip to content

Instantly share code, notes, and snippets.

View jerronimo's full-sized avatar

Eugene Kashkarov jerronimo

  • Kharkiv
View GitHub Profile
@jerronimo
jerronimo / README.md
Created August 21, 2018 15:53 — forked from Tom32i/README.md
Simple list hydrator for Symfony2

Simple list hydrator for #Syfmony2

Sample User repository method that return all user names in an array:

/**
 * Find user names
 *
 * @return array
 */

public function findAllNames()

@jerronimo
jerronimo / tz.php
Last active February 8, 2018 09:03
<?php
//
//1. Write an application which calculates the least amount of Euro-Coins needed for any input amount
//7,21 Euro = 6 Coins (2€+2€+2€+1€+0,2€+0,01€)
//3,72 Euro = 6 Münzen (2€+1€+0,5€+0,2€+0,02€) - >>>> it looks like mistake. Right answer should be 5 coins
class App {
/**
* Different coins nominals
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<section id="facebook" class="profile-block profile-social-block facebook">
<div class="title"><span>Facebook</span></div>
<script>(function(d, s, id) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<section id="twitter" class="profile-block profile-social-block twitter">
<div class="title"><span>Twitter</span></div>
IF CLIENT & ARTIST ARE in same country) the rules are very simple:
These rules are for generating the invoice and select the appropriate INVOICE template
When we say apply VAT or with VAT it is ALWAYS talking about the ARTIST VAT
Rule 1. INDIVIDUAL USER (ARTIST)
--> NO VAT be definition
use template "TEMPLATE INVOICE WITH NO VAT"
Rule 2. LEGAL USER (ARTIST) NOT REGISTERED to VAT
--> NO VAT
use template "TEMPLATE INVOICE WITH NO VAT"
Rule 3. LEGAL USER (ARTIST) REGISTERED to VAT
<?php
namespace Acted\ProfileBundle\Services;
use Acted\CoreBundle\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Abraham\TwitterOAuth\TwitterOAuth;
use Acted\CoreBundle\Entity\UserOAuth;
use Facebook\Facebook;
@jerronimo
jerronimo / accessDeniedListener.php
Created November 3, 2017 01:31 — forked from charliepage88/accessDeniedListener.php
Functionality to override symfony 403 Error Access denied. Sets flash message and redirect (back to previous page, or homepage)
<?php
namespace Atd\UserBundle\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent,
Symfony\Component\Security\Core\Exception\AccessDeniedException,
Symfony\Component\HttpFoundation\Request,
Symfony\Component\HttpFoundation\RedirectResponse,
Symfony\Component\HttpFoundation\Session\Session,
Symfony\Component\Routing\Router;
@jerronimo
jerronimo / stripe-checkout.html
Created November 1, 2017 21:17 — forked from ziadoz/stripe-checkout.html
Custom Stripe Checkout Button
<form action="." method="post">
<noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript>
<input
type="submit"
value="Pay with Card"
data-key="PUBLISHABLE STRIPE KEY"
data-amount="500"
data-currency="cad"
data-name="Example Company Inc"
/**
* @param {string} box
* @param {string} all
* @param {string} item
*/
function checkboxList(box, all, item) {
//select all statuses
$(box).on('change', all, function(){
$(item).prop('checked', $(this).prop('checked'));
});
{
member: {
user_id: 21,
first_name: "Melvina",
last_name: "Ernser",
email: "trogvar22+1@gmail.com",
primary_phone: "1111111111111111",
avatar: "/fr/fake/img_avatar/artist/59d34d41bee2e.jpg",
nationality: "BV",
user_type: "individual",