Skip to content

Instantly share code, notes, and snippets.

View erivello's full-sized avatar

Edoardo Rivello erivello

  • Vittorio Veneto, Italy
View GitHub Profile
@azimidev
azimidev / disposable_email_addresses
Last active December 22, 2022 06:51
Notify me of any update
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@jmolivas
jmolivas / DefaultController.php
Last active August 20, 2022 18:57
Drupal 8 example: How to render a Twig template and load a CSS file from a Controller
<?php
namespace Drupal\acme\Controller;
use Drupal\Core\Controller\ControllerBase;
class DefaultController extends ControllerBase
{
/**
@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@matteocaberlotto
matteocaberlotto / deploy-symfony.sh
Last active April 20, 2022 14:51
Deploy symfony 2+ applications (multiple environment)
#!/bin/bash
# include config
# config example below:
#
#
# Example deploy_config.sh
#
# dev_env() {
@matteocaberlotto
matteocaberlotto / sf2gen.sh
Last active December 24, 2015 18:59
a bash script to automate symfony 2 project creation (composer, vhost and local dns)
#!/bin/bash
echo "Enter project name"
read PROJECT
DIRECTORY="/Users/teito/workspace/$PROJECT"
VHOST="/etc/apache2/extra/vhosts/$PROJECT.conf"
@mrosati84
mrosati84 / capture.js
Last active August 3, 2016 16:37
Test automation for responsive layout using PhantomJS
/*
requires: phantomjs, async
usage: phantomjs capture.js
*/
var async = require('async'),
sizes = [
[320, 480],
[1024, 768],
[1280, 800],
@matteocaberlotto
matteocaberlotto / gist:5652919
Last active December 17, 2015 18:28
Symfony cache/log folders permissions setup
# chmod
chmod +a "_www allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
# setfacl
setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
@K-Phoen
K-Phoen / AppKernel.php
Created January 9, 2013 15:38
Functional tests for standalone Symfony2 bundles
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
return array(
@albertodebortoli
albertodebortoli / gist:4100669
Created November 17, 2012 22:11
HelpEmotion
RESTful routes
GET /emergencies
POST /emergencies
GET /emergencies/:id
POST /emergencies/:id/offers
GET /emergencies
{
"emergencies": [
@stefanosala
stefanosala / gist:3881637
Created October 12, 2012 21:31
My vhosts configuration
<VirtualHost *:80>
ServerName dev
ServerAlias *.dev
DocumentRoot /Users/stefanosala/Sites
SetEnv LocalDev true
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.* [NC]