Skip to content

Instantly share code, notes, and snippets.

View cvega93's full-sized avatar
🎯
Growth hacker

Cristian Vega cvega93

🎯
Growth hacker
  • Talently
  • Lima
View GitHub Profile
@cvega93
cvega93 / sitemapController.php
Last active April 4, 2018 23:36
Sitemap generation example
# Code example to generate sitemap with https://github.com/dwightwatson/sitemap
<?php
namespace App\Http\Controllers\Admin;
use App\Services\DebateService;
use App\Http\Controllers\Controller;
use App\Services\GroupService;
use App\Services\InvitationService;
@cvega93
cvega93 / ubigeos_peru.sql
Created March 16, 2018 15:31
Perú, base de datos de Ciudades, Provincias y Distritos
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.7.17-0ubuntu0.16.04.2 - (Ubuntu)
-- SO del servidor: Linux
-- HeidiSQL Versión: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
@cvega93
cvega93 / acortarUrl.php
Created March 12, 2018 14:57
Acortar enlace con Bitly
$urlCurrent = $_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
function acortar_url($url)
{
$usuario = "o_89kncra68";
$apikey = "R_4f27f66b97292542888d9530443f2cd4";
$temp = "http://api.bit.ly/v3/shorten?login=" . $usuario . "&apiKey=" . $apikey . "&uri=" . $url . "&format=txt";
return file_get_contents($temp);
}
@cvega93
cvega93 / ratingstars.php
Created February 23, 2018 23:10
Loop rating stars with blade + Google Markup Microdata
//use Fontawesome
@for ($x = 1; $x <= $name->ratingAverage; $x++)
<i class="fa fa-star"></i>
@endfor
@if (strpos($name->ratingAverage, '.'))
<i class="fa fa-star-half-o"></i>
@php
$x++;
@endphp
@endif
@cvega93
cvega93 / Culqi class para Vue.js
Created February 13, 2018 21:02
Clase para obtener un evento asíncrono de Culqi
<template>
<div class="card">
<form action="#" class="form-monkey form-buy-membreship" id="culqi-card-form">
<div class="row">
<div class="block-form">
<div class="col-sm-6">
<div class="form-group">
<label for="card[email]">Email</label>
<input type="text" class="form-control" placeholder="Correo electrónico"
v-model="user.email"