Skip to content

Instantly share code, notes, and snippets.

View nbpalomino's full-sized avatar
🎯
Focusing

Nick B. Palomino nbpalomino

🎯
Focusing
View GitHub Profile
@nbpalomino
nbpalomino / golang-tls.md
Created January 25, 2018 20:17 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
server {
listen 80 default;
server_name laravel.app;
root /home/vagrant/Apps;
index index.php index.html;
autoindex on;
#sendfile on;
location / {
@nbpalomino
nbpalomino / perfectelementary.bash
Created June 2, 2016 03:42
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@nbpalomino
nbpalomino / installphp7.sh
Created February 26, 2016 20:58 — forked from tronsha/installphp7.sh
Install PHP7 to Ubuntu
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
@nbpalomino
nbpalomino / CopyGit2Directory.sh
Last active December 28, 2015 20:10
Copy modified files to another directory for deploy.
git diff --name-only | xargs cp -v --parents --t ../../Proyectos/Criminalidad
@nbpalomino
nbpalomino / Webhook_Deploy.php
Last active October 31, 2016 19:36
Script for Deploy using Webhooks
<?php
interface GitProvider {
public function getRepository();
public function getUser();
public function getCommit();
public function getBranch();
public function hashCommit();
}
@nbpalomino
nbpalomino / soloPermitir.js
Created August 11, 2015 15:44
Script for allow just a defined string of chars
var soloPermitir = function (a){
// console.dir($(this).data('permitido'));
// console.dir(a.data);
var permitido = ($(this).data('permitido') || a.data.permitido).toString();
var c=a.which,
d=a.keyCode,
e=String.fromCharCode(c).toLowerCase(),
f=permitido;
(-1!=f.indexOf(e)||9==d||37!=c&&37==d||39==d&&39!=c||8==d||46==d&&46!=c)&&161!=c||a.preventDefault();
@nbpalomino
nbpalomino / nginx
Created July 2, 2015 03:20
nginx Rewrite PHP
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/amautas/www/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name www.amautas.net;
@nbpalomino
nbpalomino / SocialBase.php
Created March 10, 2014 20:03 — forked from Problematic/SocialBase.php
Ejemplo de como usar herencia de una clase abstracta para desacoplar propiedades de una Entidad.
<?php
namespace UP\SocialBundle\Entity;
/**
* UP\SocialBundle\Entity\SocialBase
* @orm:Entity
* @orm:HasLifecycleCallbacks
* @orm:InheritanceType("JOINED")
* @orm:DiscriminatorColumn(name="class_name", type="string")