Skip to content

Instantly share code, notes, and snippets.

@jesusgoku
jesusgoku / speed_test.sh
Created April 7, 2015 15:04
Speed Test from Terminal
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
@jesusgoku
jesusgoku / truecrypt-md.bat
Created April 8, 2015 12:35
Mount and Dismount TrueCrypt volumes from CMD
@echo off
if "%1" == "mount" (
set volumeFile=%2
set letter=%3
goto Mount
)
if "%1" == "dismount" (
set letter=%2

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@jesusgoku
jesusgoku / README.md
Last active August 29, 2015 14:21
Color Schemes for Terminator
@jesusgoku
jesusgoku / primary_display.sh
Last active August 29, 2015 14:22
Set primary display on Ubuntu
xrandr --output HDMI-0 --primary
@jesusgoku
jesusgoku / line.by.line.sh
Created June 19, 2015 04:53
Read file line by line from bash script
#!/usr/bin/env bash
while IFS='' read -r line || [[ -n $line ]]; do
echo "$file"
done < "$1"
@jesusgoku
jesusgoku / generate_dictionary.sh
Created July 22, 2015 04:58
Create spanish dictionary for use with PHPStorm
sudo apt-get install aspell aspell-es -y
aspell --lang=es --encoding=utf-8 dump master | aspell --lang=es --encoding=utf-8 expand | tr [:space:] '\n' > spanish-utf8.dic
@jesusgoku
jesusgoku / class_constants.js
Created July 23, 2015 15:10
Contants class in JavaScript
var Contants = {};
(function () {
var values = { VERSION: '0.0.1' };
var properties = {};
for (var i in values) {
properties[i] = {
value: values[i],
writable: false
@jesusgoku
jesusgoku / pdf_extract_cover.sh
Created August 5, 2015 06:15
Extract first page from PDF files and convert to JPEG
#!/usr/bin/env bash
for f in *.pdf; do
PDF_OUPUT=`echo "$f"| sed 's/\.pdf$/_0.pdf/'`
JPEG_OUPUT=`echo "$f"| sed 's/\.pdf$/.jpeg/'`
pdftk "$f" cat 1 output "$PDF_OUPUT"
convert -trim "$PDF_OUPUT" "$JPEG_OUPUT"
rm -f "$PDF_OUPUT"
done
@jesusgoku
jesusgoku / compress_exclude.sh
Last active August 29, 2015 14:26
Compress files and exclude folders or files
# With ZIP. Include complete pattern to exclude
zip -9 -r -x"intranet/.git/*" \
-x"intranet/app/logs/*" \
-x"intranet/app/cache/*" \
-x"intranet/.idea/*" \
-x"intranet/files/*" \
-x"intranet/web/compiled/*" \
-x"intranet/vendor/*" \
-x"intranet/web/assets/*" \
intranet.zip \