$ sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
$ sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \;
$ sudo rm -rf /Library/Caches/com.apple.iconservices.store
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 App\UserBundle\Controller; | |
use Doctrine\ORM\EntityManager; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\HttpFoundation\Request; | |
/** |
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
<VirtualHost *:80> | |
ServerName yourdomain.fr | |
ServerAlias www.yourdomain.fr | |
ProxyRequests off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
<Location /> | |
ProxyPass http://yourdomain.fr:3000/ |
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
require 'cgi' | |
require 'digest/md5' | |
require 'net/https' | |
require 'uri' | |
module Jekyll | |
class GistTag < Liquid::Tag | |
def initialize(tag_name, text, token) | |
super | |
@text = text |
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 | |
# original message | |
base=$(cat $1) | |
# ticket patterns | |
patterns=(ticket- issue- bug-) | |
# current branch name excluding namespace | |
current_branch=$(git symbolic-ref --short HEAD | cut -d/ -f2-) | |
# capitalize message's first char | |
message=`echo ${base:0:1} | tr '[a-z]' '[A-Z]'`${base:1} |
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
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
Assuming you have a repository hosted on git.server1.com and you want push it to another host.
Your remote "origin" is set to git.server1.com:username/repository.git
1- Create an empty repository from github interface
2- Add the "github" remote to your local repository
$ git remote add github git@github.com:username/repository.git
3- Add your previous commits into
Exclude files with ".php~" from GIT ADD :
git ls-files . | grep '\.php~$' | xargs git add
Exclude files already added by GIT ADD :
git ls-files . | grep '\.php~$' | xargs git reset --
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
#!/usr/bin/php | |
<?php | |
exec('git diff --cached --name-status --diff-filter=ACM', $output); | |
foreach ($output as $file) { | |
$fileName = trim(substr($file, 1) ); | |
if (pathinfo($fileName,PATHINFO_EXTENSION) == "php") { | |
$lint_output = array(); | |
exec("php -l " . escapeshellarg($fileName), $lint_output, $return); |
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 Acme\DemoBundle\Repository; | |
use Acme\DemoBundle\Dependency; | |
use Doctrine\ORM\EntityRepository; | |
/** | |
* Get this repository directly from the container: it will set the $dependency attribute. | |
* If you get it using Doctrine's "getRepository()", don't forget to call setDependency(). |