Skip to content

Instantly share code, notes, and snippets.

View jbinfo's full-sized avatar

Lhassan Baazzi jbinfo

View GitHub Profile
@SRJ9
SRJ9 / error_x86_64_gnu_gcc_fix.sh
Last active September 19, 2020 16:39
Fix error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
#!/bin/bash
# https://github.com/scrapy/scrapy/issues/2115
sudo apt-get install python3 python-dev python3-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
python-pip
.mar-left-5 {
margin-left: 5px;
}
.mar-left-10 {
margin-left: 10px;
}
.mar-left-15 {
margin-left: 15px;
@shibli049
shibli049 / mysqldb_python3.sh
Last active April 23, 2023 05:48
Install mysqlclient for python3
#sudo pip3 install mysqlclient fails with mysql_config not found
sudo apt-get install libmysqlclient-dev
#without pip3 it will not going to work for python3
sudo pip3 install mysqlclient
# to run django migration
python3 manage.py migrate

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

<?php
require_once __DIR__.'/autoload.php.dist';
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 9, 2024 21:36
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@ramonvictor
ramonvictor / get-youtube-info.js
Last active December 9, 2020 15:43
Javascript/jQuery function to get youtube video information by passing video url.
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;
};
@zhenyi2697
zhenyi2697 / urlparse.py
Created March 27, 2013 17:52
Python: urlparse demo
#!/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')
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,