Skip to content

Instantly share code, notes, and snippets.

View skwi's full-sized avatar
👥
N1que les clones

Cédric skwi

👥
N1que les clones
View GitHub Profile
@skwi
skwi / roleSpecificBehavior.php
Created April 18, 2013 13:35
Symfony role specific behavor without elseif
public function myfunction() {
switch(true) {
case $this->securityContext->isGranted('ROLE_1'){
#code
break;
case $this->securityContext->isGranted('ROLE_2'){
#code
break;
case $this->securityContext->isGranted('ROLE_3'){
#code
@skwi
skwi / gist:6006164
Last active December 19, 2015 19:28
Load jQuery from Google API, minified in environments other than dev
<script
type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery{{ app.environment == 'dev' ? null : '.min' }}.js">
</script>
@skwi
skwi / pre-commit
Created June 11, 2014 07:11
PHP pre-commit
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@skwi
skwi / keybase.md
Created July 17, 2017 11:45
Keybase claim

Keybase proof

I hereby claim:

  • I am skwi on github.
  • I am skwi (https://keybase.io/skwi) on keybase.
  • I have a public key ASCSZ4ZFmFM81IluDcO-QFo0AgLoxFMH7nPbH9kQH4OxYgo

To claim this, I am signing this object: