Skip to content

Instantly share code, notes, and snippets.

View d33pcode's full-sized avatar

Marco Panunzio d33pcode

View GitHub Profile
@d33pcode
d33pcode / colorlog.sh
Last active November 7, 2017 14:07
colorlog
logfile="$(pwd)/amazing.log"
###################
# ANSI escape codes
###################
RED='\033[0;31m'
LRED='\033[1;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NC='\033[0m' # nocolor
@d33pcode
d33pcode / socketcodes.txt
Last active May 2, 2017 14:29
TCP sockets error codes
{
"0" : "Success",
"1" : "Operation not permitted",
"2" : "No such file or directory",
"3" : "No such process",
"4" : "Interrupted system call",
"5" : "Input/output error",
"6" : "No such device or address",
"7" : "Argument list too long",
"8" : "Exec format error",
<?php //app/libraries/MultiUserProvider.php
use Illuminate\Auth\UserProviderInterface,
Illuminate\Auth\UserInterface,
Illuminate\Auth\GenericUser;
class MultiUserProvider implements UserProviderInterface {
protected $providers;
@d33pcode
d33pcode / gist:2df57caf6d95cf48b275
Created March 25, 2016 22:57 — forked from yograterol/gist:99c8e123afecc828cb8c
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" workaround
"gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory" CentOS's and Fedora +22 workaround
Install `redhat-rpm-config`
$ sudo dnf install redhat-rpm-config
@d33pcode
d33pcode / gist:5a142a8ff697ef5735c1
Created February 5, 2016 11:07 — forked from markoheijnen/gist:6129265
Fantastich ElasticSearch: add numeric meta key
<?php
class My_Elasticsearch {
public function __construct() {
add_filter( 'elasticsearch_config_facets', array( $this, 'add_facets' ) );
add_filter( 'elasticsearch_config_fields', array( $this, 'add_fields' ) );
add_filter( 'elasticsearch_indexer_map_field', array( $this, 'indexer_map_field' ), 10, 2 );
add_filter( 'elasticsearch_indexer_build_document', array( $this, 'indexer_build_document' ), 10, 2 );
}
@d33pcode
d33pcode / JSF: Creating Template.md
Last active October 2, 2015 09:57
#devnotes JSF templates

Templates

Templates in a web application defines a common interface layout and style. For example, a same banner, logo in common header and copyright information in footer. JSF provides following facelets tags to provide a standard web interface layout.

Step Tag Description
1 ui:insert Used in template file. It defines contents to be placed in a template. ui:define tag can replaced its contents.
2 ui:define Defines the contents to be inserted in a template.
Can't compile with mvn clean install inside your project?
Try deleting your .m2 local repository, works most of the times.
[Location: ~/.m2]
@d33pcode
d33pcode / Model for new desktop entries
Last active September 29, 2015 09:43
Generic model for creating new desktop entries
[!] desktopentry.desktop should have EXACTLY the same name of the application to prevent Linux from getting empty :S
Place this file in the /usr/share/applications directory so that it is accessible by everyone,
or in ~/.local/share/applications if you only wish to make it accessible to a single user.
[Desktop Entry]
Encoding=UTF-8
Name=AppName
Comment=PutANiceCommentHere
Exec=/home/path/to/executable
Icon=/home/path/to/icon
@d33pcode
d33pcode / bash-tweaks.sh
Last active February 8, 2016 22:18
Customizing bashrc
##################################
# d33pcode's custom bashrc #
##################################
# geeky tweaks for your terminal #
##################################
#EXPORTS
export JAVA_HOME=/usr/java/latest/jre
export STUDIO_JDK=/usr/java/jdk1.7.0_79
export PATH=/opt/bin/local:/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH