Skip to content

Instantly share code, notes, and snippets.

View jbinfo's full-sized avatar

Lhassan Baazzi jbinfo

View GitHub Profile

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'>
@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')
@jbinfo
jbinfo / Preferences.sublime-settings
Created July 23, 2015 07:36
Preferences.sublime-settings
{
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"word_wrap": false,
"color_scheme": "Packages/Github Color Theme/GitHub.tmTheme",
"ignored_packages":
[
"Vintage"
]
}
@jbinfo
jbinfo / all_form_errors.macro.twig
Last active December 12, 2015 06:49
TWIG macro for display all Symfony2 form errors in your template
{#
this macro is for display all form errors(globals, fields errors)
@param is_global have two values 1 and 2
1 => for a global error
2 => for a field error
#}
{% macro all_form_errors(form, is_global) %}
{% set is_global = is_global|default(1) %}
{% for error in form.get('errors') %}
<span style="display: block">
@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
@jbinfo
jbinfo / LoginSuccessHandler.php
Last active February 5, 2016 10:42
Symfony: Right way to get default target URL from session http://goo.gl/SNq3Tr
<?php
namespace AppBundle\Security\Authentication\Handler;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
.mar-left-5 {
margin-left: 5px;
}
.mar-left-10 {
margin-left: 10px;
}
.mar-left-15 {
margin-left: 15px;
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;
};
var secondes = Math.floor((Math.random() * 10) + 3);
var duration = secondes;
$('#activity-popup-dialog-body').find('.not-following').find('button.follow-button').each(function() {
var _this = this;
setTimeout(function() {
$(_this).trigger('click');
}, duration * 1000);
duration += secondes;
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 21 columns, instead of 7. in line 3.
id,username,fullname,emails,fbPage,externalUrl,biography,followedBy,follows,isPrivate,isVerified,isBusinessAccount,businessCategory,businessEmail,businessPhone,businessAddressStreet,businessAddressZipcode,businessAddressCity,businessAddressRegion,businessAddressCountryCode,hashtags
5734709815,tasteititalian,Taste IT,,,https://m.facebook.com/TasteItitaliantakeaway/,"‼️The first independent Italian Gelateria in Greater Manchester ‼️
Stonebaked pizza 🍕 artisan gelato 🍦 baked pasta 🍝 tasty arancini.",430,146,0,0,1,Restaurants,tasteitsalford@gmail.com,441616980410,69 BLACKFRIARS ROAD,M3 7DB,City of Salford,,GB,pizzauk
3667203339,mobipizzeria,🇮🇹Mobile Wood Fired Pizza🇬🇧,,,https://www.facebook.com/mobipizzeria/,"Mobile pop-up wood fired pizza UK-wide.
We cater for weddings, corporate events, private parties, birthdays, festivals, concerts, fetes, and many more",7486,3492,0,0,1,Restaurants,info@mobipizzeria.co.uk,443300100270,,SG191RB,St Neots,,GB,pizzauk
2986836082,zialuciapizza,Zia Lucia,,,http://www.zialucia.com/,