Skip to content

Instantly share code, notes, and snippets.

View emir's full-sized avatar

Emir Karşıyakalı emir

View GitHub Profile
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Table(name="users")
* @ORM\Entity
@emir
emir / hell.cfm
Created March 15, 2018 10:46
go to hell
<cfcomponent>
<cfset this.hello = "Hello" />
<cfset this.world = "world" />
<cffunction name="sayHello">
<cfreturn this.hello & ", " & this.world & "!" />
</cffunction>
<cffunction name="setHello">
<cfargument name="newHello" type="string" required="true" />
@emir
emir / index.php
Created September 10, 2017 21:07
LogPusher Example
<?php
require __DIR__ . '/vendor/autoload.php';
$pusher = new \LogPusher\LogPusherClient(
new \GuzzleHttp\Client([]),
'hello@logpusher.com',
'PASSWORD',
'API_KEY'
);

Keybase proof

I hereby claim:

  • I am emir on github.
  • I am emir (https://keybase.io/emir) on keybase.
  • I have a public key ASBogsWl9sLGUEIscJ-aA_8CM7CIPi-j358IErpP4mqdbAo

To claim this, I am signing this object:

@emir
emir / .zshrc
Created August 26, 2017 10:20
adding active language to right side of zsh prompt
function active_lang {
osascript -e 'tell application "System Events" to tell process "SystemUIServer" to get the value of the first menu bar item of menu bar 1 whose description is "text input"'
}
RPROMPT='$(active_lang)'
@emir
emir / horizon.php
Created July 29, 2017 15:55
config/horizon.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Horizon Redis Connection
|--------------------------------------------------------------------------
|
| This is the name of the Redis connection where Horizon will store the
@emir
emir / Type.php
Created July 27, 2017 11:35
Type Value Object for AIG Identity Service
<?php
namespace App\Domain\Identity\ValueObjects;
final class Type
{
const TURKISH_TYPE = 'TURKISH';
const FOREIGNER_TYPE = 'FOREIGNER';
@emir
emir / tax_validation.php
Last active December 26, 2023 18:40
PHP Vergi Numarası Doğrulama
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{
@emir
emir / without-visual-debts.php
Created May 31, 2017 00:24
Without Visual Debts (Not my opinion)
<?php
class Event {
protected $events = [];
function listen($name, $handler)
{
$this->events[$name][] = $handler;
}
@emir
emir / visual-debts.php
Created May 30, 2017 23:09
Visual Debts
<?php
interface EventInterface {
public function listen(string $name, callable $handler) : void;
public function fire(string $name) : bool;
}
final class Event implements EventInterface {
protected $events = [];