Skip to content

Instantly share code, notes, and snippets.

View chalasr's full-sized avatar

Robin Chalas chalasr

View GitHub Profile
@chalasr
chalasr / imgResize.md
Last active August 29, 2015 14:19
ImageResizing : light and simple script for jpg/png images resizing

imageResize

Light and simple script made for resize all images presents in current folder and recursively. Work on JPEG and PNG images (mixed or not).

#Use

  • Copy the code and paste it in imgResize.php file or download it.
  • Place the file into your image(s) folder (You can have many image(s) folders into).
@chalasr
chalasr / Personne.php
Last active August 29, 2015 14:27
How make an auto-completed field for filter entity results in list view, using entity property (not related entity) ?
<?php
namespace Application\PersonneBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Personne
*
* @ORM\Table()
This file has been truncated, but you can view the full file.
<!DOCTYPE html><html lang="en" ng-app="weedmaps"><head><meta charset="utf-8" /><meta content="IE=Edge,chrome=1" http-equiv="X-UA-Compatible" />
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"c4a111e7e0","applicationID":"2014141","transactionName":"cVYMRBBdWQ1TFk4HAV5QFFUQW1ASGRcJDBM=","queueTime":4,"applicationTime":627,"ttGuid":"","agentToken":null,"agent":"js-agent.newrelic.com/nr-686.min.js"}</script>
<script type="text/javascript">(window.NREUM||(NREUM={})).loader_config={xpid:"UgMDUFJACgMBUFBWBg=="};window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=s(e),f=c.length,u=i(a,o,r),d=
server {
listen 80;
server_name 192.168.1.16;
root /var/www/nginx;
index index.php index.html index.htm;
client_max_body_size 1000M; # set maximum upload size
# default try order
location / {
try_files $uri $uri/ @webdav;
@chalasr
chalasr / sportroops.conf
Last active December 9, 2015 20:01
Apache2 VHOST example for sportroops local environment (dev)
<VirtualHost *:80>
ServerName sportroops.dev
ServerAlias api.sportroops.dev
DocumentRoot /var/www/html/sutunam/sportroops/web/
<Directory "/var/www/html/sutunam/sportroops/web">
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
@chalasr
chalasr / security.yml
Created December 11, 2015 17:14
Lexik\JWTAuthenticationBundle configuration
security:
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_manager
encoders:
FOS\UserBundle\Model\UserInterface: sha512
@chalasr
chalasr / node-apache-vhost
Last active December 23, 2015 16:51
Working vhost for get content of yourdomain.fr:3000 by browsing yourdomain.fr
<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/
@chalasr
chalasr / ClearIconsCacheOSX.md
Last active December 28, 2015 21:49
Clear icons cache on OSX

$ 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

@chalasr
chalasr / angularjs-interceptor.js
Created January 4, 2016 12:15 — forked from gnomeontherun/angularjs-interceptor.js
Intercept XHR/Ajax requests with AngularJS http interceptors. This allows you to globally intercept and modify requests and responses. You don't need to declare all of the methods, just the ones you need. Some example uses would be logging errors, adding extra headers, or triggering 'loading' screens. This intercepts ALL requests/responses, so y…
// 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.
@chalasr
chalasr / README.md
Last active January 8, 2016 12:36
Multiple remote on git-hosted repository

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