Skip to content

Instantly share code, notes, and snippets.

View vaporic's full-sized avatar
🏠
Working from home

Hugo Epinosa vaporic

🏠
Working from home
View GitHub Profile
@vaporic
vaporic / cors-laravel.md
Last active March 22, 2021 11:26
CORS Laravel 5.1

Activar CORS Laravel 5.1

Para activar los CORS se edita el archivo /bootstrap/app.php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
header('Access-Control-Allow-Credentials: true');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
@vaporic
vaporic / slugify.js
Created August 4, 2016 16:16
Slugify Function
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@vaporic
vaporic / social-share.html
Created September 15, 2016 13:29
Social Buttons Share
<div class="newSocials">
<ul>
<li>
<a href="https://plus.google.com/share?url=<?php the_permalink();?>" target="blank"><i class="fa fa-google-plus"></i></a>
</li>
<li>
<a class="" href="http://twitter.com/share?url=<?php the_permalink();?>&text=<?php the_title();?> on <?php bloginfo('name')?>" target="_blank"><i class="fa fa-twitter"></i></a>
</li>
<li>
<a class="" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" target="blank"><i class="fa fa-facebook"></i></a>
@vaporic
vaporic / zsh.md
Created September 18, 2016 05:10 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@vaporic
vaporic / countries.sql
Created September 20, 2016 19:29
Countries SQL
CREATE TABLE `paises` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) DEFAULT NULL,
`nombre` varchar(80) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
INSERT INTO `paises` VALUES(1, 'AF', 'Afganistán');
INSERT INTO `paises` VALUES(2, 'AX', 'Islas Gland');
INSERT INTO `paises` VALUES(3, 'AL', 'Albania');
@vaporic
vaporic / permisos.sh
Created September 21, 2016 14:51
Permisos /var/www Ubuntu
sudo adduser $USER www-data
sudo chown $USER:www-data -R /var/www
sudo chmod 0755 -R /var/www
sudo chmod g+s -R /var/www
@vaporic
vaporic / multiple_ssh_setting.md
Created September 22, 2016 21:02 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@vaporic
vaporic / automate-deploy.sh
Created September 22, 2016 22:54
Automatic Deploy Git
mkdir ~/.ssh
vim known_hosts - if you already have known_hosts, skip this.
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
ssh-keygen -t rsa -C "user.email
@vaporic
vaporic / devastator-keyboard.sh
Created September 23, 2016 05:01
Config Keyboard Devastator
#!/bin/bash
#Script para encender el LED del Scroll Lock
on=$(xset -q | grep 'Scroll Lock:' | cut -d ":" -f 7)
if [ $on == "off" ]; then
xset led named "Scroll Lock";
else
xset -led named "Scroll Lock";
fi