Skip to content

Instantly share code, notes, and snippets.

View jbinfo's full-sized avatar

Lhassan Baazzi jbinfo

View GitHub Profile
.mar-left-5 {
margin-left: 5px;
}
.mar-left-10 {
margin-left: 10px;
}
.mar-left-15 {
margin-left: 15px;
@jbinfo
jbinfo / gist:ce5600eb7ea276dc194c
Created December 16, 2015 15:11 — forked from serapheem/gist:4153979
Symfony2 - Redirect one route to another from routing.yml
SomeRoute:
pattern: /someroute
defaults:
_controller: SomeBundle:Controller:action
AnotherRoute:
pattern: /anotherroute
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: SomeRoute
var getYoutubeIdByUrl = function( url ){
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/;
var match = url.match(regExp);
if(match&&match[7].length==11){
return match[7];
}
return false;
};
@jbinfo
jbinfo / urlparse.py
Last active August 29, 2015 14:08 — forked from zhenyi2697/urlparse.py
#!/usr/bin/python
# The urlparse module provides functions for breaking URLs down into their
# component parts, as defined by the relevant RFCs.
from urlparse import urlparse
# PARSING
parsed = urlparse('http://user:pass@NetLoc:80/path;parameters?query=argument#fragment')

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>