Skip to content

Instantly share code, notes, and snippets.

View mberizzo's full-sized avatar

Matias Berizzo mberizzo

  • Rosario - Santa Fe - Argentina
View GitHub Profile
@mberizzo
mberizzo / bower.json
Last active November 5, 2015 15:02
Gulp, Bower, Bootstrap Sass
{
"name": "jym-comunicaciones",
"main": "index.js",
"version": "0.0.0",
"authors": [
"Matias Berizzo"
],
"description": "JyM Comunicaciones - Ecommerce",
"license": "MIT",
"ignore": [
@mberizzo
mberizzo / responsive.css
Last active August 29, 2015 14:17
CSS Media Queries
/*-----------start MEDIA QUERIES-----------*/
/*start IPHONE*/
/*@media (min-width: 240px) and (max-width: 479px) {*/
@media (min-width: 240px) and (max-width: 767px) {
}
/*end IPHONE*/
/*start IPHONE VERTICAL*/
@media (min-width: 240px) and (max-width: 479px) {
@mberizzo
mberizzo / lamp - mysql
Last active July 18, 2020 19:20
Ubuntu install LAMP - commands
You can import "file.sql" file using the standard input like this:
* mysql -u <user> -p <dbname> < file.sql
Import mysql database in laradock. Note: database "my-database-name" should be exists (empty)
docker-compose exec -T mysql mysql -uroot -proot my-database-name < /home/matias/Downloads/my-database-name.sql
Import all mysql databases
mysql -u root -p < all_databases.sql
You can export all mysql databases to "all_databases.sql"
ErrorException: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 954
It's because of a lack of memory. You need to set up a swap file so that composer can do it's thing:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k
mkswap /swapfile
swapon /swapfile
@mberizzo
mberizzo / PHP Unzip
Last active March 12, 2019 06:57
PHP script that unzip file.zip
<?php
// When i have to upload multiple files in a shared hosting:
// 1. Compress your project and upload to your shared server
// 2. Visit url via shell (ex: "curl http://domain.com/unzip.php &") or any navigator
// Alternative step 2 (sometimes php throw timeout error):
// 1. Create a cronjob that visit unzip.php file (just one time)
error_reporting(E_ALL ^ E_STRICT);
ffmpeg -i video.mkv -acodec libmp3lame audio.mp3
@mberizzo
mberizzo / gist:5636ecb2dc10af52e46bb456248fff00
Created January 27, 2017 18:53
Convert webm video to mp4
ffmpeg -i output.webm -r 10 -cpu-used 5 -c:v libx264 -crf 20 -c:a aac -strict experimental -loglevel error output.mp4
avconv -i video.webm -s 640x480 output.webm
@mberizzo
mberizzo / GEO IP
Created January 23, 2018 12:22
Get Country details by IP
http://freegeoip.net/csv/
# exclude everything except directory themes/mytheme
/*
!README.md
!.editorconfig
!.gitignore
!artisan
!composer.json
!server.php
!.htaccess