Skip to content

Instantly share code, notes, and snippets.

View legomolina's full-sized avatar

Cristian Molina legomolina

View GitHub Profile
@legomolina
legomolina / xdebug-php.md
Last active July 5, 2018 20:26 — forked from ankurk91/xdebug-mac.md
php xDebug on Ubuntu/Mac and phpStorm 2017

🪲 Install and Configure xDebug on Ubuntu/Mac and PhpStorm 🐘

  • Assuming that you have already installed php and apache
  • Install xDebug php extension
# Ubuntu 16.04, php 7.0
sudo apt-get install php-xdebug

# Ubuntu 14.04, php 5.6 
sudo apt-get install php5-xdebug
@legomolina
legomolina / Gulpfile.js
Created December 24, 2017 18:43
Gulpfile to compile scss, minify css, js and compress images. Development and production
// Gulp
var gulp = require('gulp');
// Sass/CSS stuff
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
// JavaScript
var uglify = require('gulp-uglify');
@legomolina
legomolina / password.php
Created December 2, 2017 00:48
Simple snippet to create a hashed password via php command line
<?php
if(count($argv) <= 1) {
print "Usage: php -f password.php mypassword [cost = 10]\n\n";
exit();
}
$password = $argv[1];
$cost = (count($argv) > 2) ? $argv[2] : 10;
$encPass = password_hash($password, PASSWORD_BCRYPT, array("cost" => $cost));
@legomolina
legomolina / style.css
Created May 18, 2016 21:21
Center horizontally and vertically fixed div with only css
#my-div {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 80vh; /* Whatever you want*/