Skip to content

Instantly share code, notes, and snippets.

@jesusgoku
jesusgoku / apache_symfony_base.conf
Created August 13, 2015 05:54
Bash script for create Apache conf for Symfony site
<VirtualHost *:8080>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName SERVER_NAME
ServerAlias www.SERVER_NAME
# With ImageMagick and Potrace
convert input.jpg output.ppm
potrace -s output.ppm -o svgout.svg
# With AutoTrace
autotrace -output-file ouput.svg -output-format svg --color-count 4 input.bmp
@jesusgoku
jesusgoku / readable_random_string.php
Created September 25, 2015 18:53 — forked from sepehr/readable_random_string.php
PHP: Human-readable Random String
<?php
/**
* Generates human-readable string.
*
* @param string $length Desired length of random string.
*
* retuen string Random string.
*/
function readable_random_string($length = 6)
@jesusgoku
jesusgoku / NamesGenerator.php
Last active January 2, 2016 12:53
Port of NameGenerator use for Docker
<?php
namespace JesusGoku;
/**
* NamesGenerator
*
* Port of NameGenerator use for Docker
*
* @author Jesús Urrutia <[email protected]>
@jesusgoku
jesusgoku / sf-deploy.sh
Created October 1, 2015 21:34
Symfony2 deploy script
#!/usr/bin/env bash
COMPOSER_EXECUTABLE="composer"
NPM_EXECUTABLE="npm"
BOWER_EXECUTABLE="bower"
CONSOLE_COMMAND="php app/console"
SYMFONY_ENV="prod"
SET_PERMISSIONS=false
PREFIX="eval"
SHOW_HELP=false
@jesusgoku
jesusgoku / compare.sh
Created November 16, 2015 15:27
Compare Diffs in to folders and files
# Compare files in two folders
diff -rq folder1 folder2
# Compara diff files in two folders
diff -w folder1 folder2
@jesusgoku
jesusgoku / idea.properties
Last active January 5, 2016 13:37
JetBrains IDEs with support for case sensitive file system. Save this file on ~/Library/Preferences/WebIde90 The last folder change with your JetBrains IDE.
idea.case.sensitive.fs=true
@jesusgoku
jesusgoku / gist:032129a23846461d4990
Created January 6, 2016 15:23 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jesusgoku
jesusgoku / download_from_web.sh
Last active February 10, 2016 18:53
WGET - Download all files from page
wget -nd -r -l 1 -A jpg http://example.com/listing/
# -nd No directory option, all on base current directory
# -r Recursive
# -l Level of recursive
# -A Extension download
@jesusgoku
jesusgoku / delete_remote_branch.sh
Created March 1, 2016 15:35
Git, delete remote branch
# For Git >= 1.7.0
git push origin --delete <branchName>