Skip to content

Instantly share code, notes, and snippets.

View maitret's full-sized avatar
🤓
Programando ando...

Luis S. Lopez Maitret maitret

🤓
Programando ando...
View GitHub Profile
@maitret
maitret / dabblet.css
Created February 4, 2015 19:04 — forked from anonymous/dabblet.css
Ratings Stars
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
@maitret
maitret / datosGeo.php
Created October 5, 2015 03:13 — forked from fitorec/datosGeo.php
Datos geograficos googleMaps GeoData
<?php
function geocode($lugar){
$lugarSanizado = str_replace (" ", "+", $lugar);
$urlBase = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $lugarSanizado . "&sensor=false";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urlBase);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = json_decode(curl_exec($ch), true);
@maitret
maitret / states_hash.json
Created January 16, 2016 16:48 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
// LOAD AJAX PAGES
function loadURL(url, container) {
$.ajax({
type: "GET",
url: url,
dataType: 'html',
cache: true,
beforeSend: function(){
container.html('<h1><i class="fa fa-cog fa-spin"></i> Loading...</h1>').fadeIn('fast');
},
@maitret
maitret / facebook.php
Created July 16, 2016 01:31 — forked from jonathantneal/facebook.php
Getting social media feeds as JSON in PHP
<?php
/* Getting a JSON Facebook Feed
==========================================================================
1. Sign in as a developer at https://developers.facebook.com/
2. Click "Create New App" at https://developers.facebook.com/apps
3. Under Apps Settings, find the App ID and App Secret
@maitret
maitret / WebSQL.html
Created July 26, 2016 07:29
Ejemplo de WebSQL, se puede usar en PhoneGap y navegadores soportados.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!--
This is an example that shows how to create an application that uses
an embedded sqlite database
in a mobile device (iphone,ipod,ipad,android using phonegap, jquery
and sqlite.
@maitret
maitret / PushNotifications.php
Created August 12, 2016 09:37
Enviar notificaciones push a dispositivos Android, Windows Phone 8 e iOS
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AI........';
// (iOS) Private key's passphrase.
private static $passphrase = 'EL_PASS_QUE_PUSISTE_EN_EL_PEM';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "bla_bla";
@maitret
maitret / check_mysql_service.sh
Last active October 5, 2016 12:02
Checar si esta corriendo el servicio de MySQL en el servidor
#!/bin/bash
UP=$(/etc/init.d/mysql status | grep running | grep -v not | wc -l);
ServerName=$(hostname -f)
if [ "$UP" -ne 1 ];
then
echo "MySQL: se murio el hijo de puta! :@";
service mysql restart
mail -s "MySQL quiere revivir! ($UP) $ServerName" maitret@myhostmx.com <<< "Estatus de MySQL en $ServerName: $UP"
else
echo "Al parecer todo anda sobre ruedas :D";
@maitret
maitret / index.html
Created November 19, 2016 09:25 — forked from anonymous/index.html
Capture FB Reactions count and show them on webpage
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My FB Reactions Page</title>
<style>
html {
box-sizing: border-box;
width: 100%;