This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/fail2ban/jail.local | |
# [...] | |
[nginx-dos] | |
# Based on apache-badbots but a simple IP check (any IP requesting more than | |
# 240 pages in 60 seconds, or 4p/s average, is suspicious) | |
# Block for two full days. | |
# @author Yannick Warnier | |
enabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Foo\Annotations; | |
/** | |
*@Annotation | |
*/ | |
class AnnotatedDescription | |
{ | |
public $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The command must be called inside the Git repository to send to the new repository | |
# Usage: push-to-new-repo.sh TARGET_REPO_URL | |
remote=origin; | |
target_repo=$1; | |
nb_branches=`git branch -r | grep $remote | grep -v master | grep -v HEAD | awk '{gsub(/[^\/]+\//,"",$1); print $1}' | wc -l | sed 's/ //g'`; | |
echo "${nb_branches} branch(es) to push"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Benjamin Marquant | |
* @website http://www.bxnxg.com | |
* @example http://website.com/My Fân Page !/ > http://website.com/my-fan-page/ and become a simple url rewriting | |
*/ | |
class UrlEncodeType { | |
private $url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git config --global alias.mergetest '!f(){ git merge --no-commit --no-ff "$1"; git merge --abort; echo "Merge aborted"; };f ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Composer doesn't work with GitHub Two Factor Authentication. | |
You have to generate a token (with "repo" scope at least) at https://github.com/settings/applications | |
Copy the token and keep it somewhere safe. | |
Run: composer config -g github-oauth.github.com paste-your-token-here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Swop\Composer\Script; | |
use Composer\Script\Event; | |
class Hooks | |
{ | |
public static function checkHooks(Event $event) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import urllib2 | |
import sys | |
import time | |
from Foundation import NSUserNotification | |
from Foundation import NSUserNotificationCenter | |
from Foundation import NSUserNotificationDefaultSoundName | |
orderId = sys.argv[1] | |
step = previousStep = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/config/config.yml | |
fos_user: | |
db_driver: ~ # Required | |
firewall_name: ~ # Required | |
user_class: ~ # Required | |
use_listener: true | |
use_username_form_type: true | |
model_manager_name: null # change it to the name of your entity/document manager | |
if you don't want to use the default one. | |
from_email: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install postgresql | |
initdb /usr/local/var/postgres -E utf8 | |
gem install lunchy | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.3.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents | |
lunchy start postgres | |
lunchy stop postgres | |
# TIPS PostgreSQL | |
# initdb /usr/local/var/postgres -E utf8 # create a database cluster |
NewerOlder