Skip to content

Instantly share code, notes, and snippets.

View emgiezet's full-sized avatar
:octocat:
Working from home

Max Małecki emgiezet

:octocat:
Working from home
View GitHub Profile
@hikari-no-yume
hikari-no-yume / example.php
Created March 20, 2017 20:02
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@pitpit
pitpit / mailcatcher-install.md
Last active November 21, 2022 04:45
Install Mailcatcher on OSX - works well with macOS Sierra High 10.12.X

05/25/2018: tested with macOS Sierra High 10.12.6

08/04/2020: added @mayesa's suggestion to fix an exception with EventMachine 08/04/2020: tested with macOS Catalina 10.15.5

Install MailCatcher:

brew install ruby
sudo gem install mailcatcher
@pwenzel
pwenzel / lamp-stack-osx-virtualhostx.md
Last active April 8, 2022 04:00
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
@denys281
denys281 / nginx.conf
Last active September 13, 2017 23:31
Symfony2 nginx virtual host (php-fpm)
server {
listen 80;
# Server name being used (exact name, wildcards or regular expression)
server_name mysite.com;
client_max_body_size 20M;
# Document root, make sure this points to your Symfony2 /web directory
root /home/user/sites/mysite.com/web;
@vrobel
vrobel / hosts
Last active December 16, 2015 07:19
facebook killer in hosts file
#add lines below to the hosts file
0.0.0.0 facebook.com
0.0.0.0 www.facebook.com
0.0.0.0 https://facebook.com
0.0.0.0 https://www.facebook.com
@jshaw
jshaw / byobuCommands
Last active May 12, 2024 20:03
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@weimeng
weimeng / gist:4527826
Last active December 11, 2015 02:08
Semantic helpers for responsive website implementations using bootstrap-sass. Specifically adds responsive replacements for the makeRow() and makeColumn() mixins included in Twitter Bootstrap.
@mixin row() {
margin-left: $gridGutterWidth * -1;
@media (max-width: 767px) { margin-left: 0; }
@media (min-width: 768px) and (max-width: 979px) { margin-left: $gridGutterWidth768 * -1; }
@media (min-width: 1200px) { margin-left: $gridGutterWidth1200 * -1; }
@include clearfix();
}
@mixin column($columns: 1, $offset: 0) {
float: left;
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@utahta
utahta / nginx.conf
Created January 6, 2013 11:01
nginx + php-fpm + reverse proxy
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@dework
dework / MenuBuilder.php
Created December 1, 2012 18:18
Symfony 2 breadcrumbs based on KnpMenuBundle
<?php
namespace Chyrius\PublicBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Chyrius\PublicBundle\Menu\RequestVoter;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MenuBuilder