Skip to content

Instantly share code, notes, and snippets.

View cyildirim's full-sized avatar
🚣‍♂️

Cyildirim cyildirim

🚣‍♂️
View GitHub Profile
@tankhuu
tankhuu / amazon_linux_install_varnish4.1.10.sh
Created December 12, 2018 10:13
Amazon Linux Install Varnish 4.1.10
sudo yum -y install autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish41/script.rpm.sh | sudo bash
wget --content-disposition https://packagecloud.io/varnishcache/varnish41/packages/el/6/varnish-4.1.10-1.el6.x86_64.rpm/download.rpm
sudo rpm -Uvh varnish-4.1.10-1.el6.x86_64.rpm
/usr/sbin/varnishd -V
@dlegatt
dlegatt / Symfony request handler.php
Last active April 21, 2024 12:16
Example of how to handle entity deserialization and validation without a form type class in Symfony
<?php
/** DefaultController.php **/
namespace AppBundle\Controller;
use AppBundle\Entity\Person;
use AppBundle\Service\RequestHandler;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@0-Sony
0-Sony / customerAttributeInstaller.php
Last active July 8, 2023 22:47
Magento 2 : Create Your Own Customer Attribute
<?php
/**
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @author Phuong LE <phuong.le@agence-soon.fr> <@>
* @copyright Copyright (c) 2016 Agence Soon (http://www.agence-soon.fr)
*/
namespace NameSpace\Customer\Setup;
use Magento\Customer\Api\CustomerMetadataInterface;
@anchetaWern
anchetaWern / php_unit_testing.markdown
Created December 6, 2012 11:06
Getting Started with Unit Testing in PHP

I finally got the time to play around with unit testing in PHP. I've heard about the term months ago but I really never had the time to play around with it because I considered it as not absolutely necessary for my development workflow. I mean I can still produce useable programs without writing a test for it right?

But admit it, testing the program that you have written is not really that exciting as writing the program itself. Sometimes we even get lazy and not test the program at all only to find things breaking on production. (Note: I'm referring to in-browser testing here)

@micktwomey
micktwomey / client.py
Created October 1, 2010 13:03
python multiprocessing socket server example
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()