This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DB{ | |
private $link; | |
function __construct( $config ){ | |
extract( $config ); | |
$this->link = mysqli_connect( $host, $user, $pass, $name, $port ) OR die( mysqli_connect_errno() ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Cache{ | |
public $path; | |
public $content; | |
public $life = 3600; // 1 hour | |
public $cache_path = 'cache/'; | |
function get( $id ){ | |
$this->id = $id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function searchItemsGoogleImages($search, $limit = 'small'){ | |
// $limit (large = 8 results, small 4 results) | |
$url = 'http://www.google.com/uds/GimageSearch?lstkp=0&rsz=' . $limit . '&hl=es&source=gsc&gss=.com&sig=fd25df5f26208aec5fddcae8457d8888&q=' . urlencode( $search ) . '&gl=www.google.com&qid=1253a7f078d655e6e&key=notsupplied&v=1.0'; | |
$data = file_get_contents( $url ); | |
$json = json_decode( $data ); | |
return $json->responseData->results; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// sendgrid.com is a cheap service to send emails | |
// swift mailer class is required, you can download it in swiftmailer.org | |
require 'class/swift/swift_required.php'; | |
class Mailer{ | |
var $author; | |
var $from; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// maxmind geolitecity class is required, you can download it in http://www.maxmind.com/app/geolitecity | |
// define variables | |
$google_maps_key = ''; | |
// import geoipcity class | |
require 'class/maxmind/geoipcity.inc'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPhotoFacebook( $fb_id ){ | |
return 'http://graph.facebook.com/' . $fb_id . '/picture'; | |
} | |
function getPhotoGravatar( $email ){ | |
return 'http://www.gravatar.com/avatar/' . md5( $email ) . '?s=50'; | |
} | |
function getPhotoTwitter( $nick ){ | |
return 'http://api.twitter.com/1/users/profile_image/' . $nick . '.json'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function searchItemsGoogle( $search, $limit = 'large' ){ | |
// $limit (large = 8 results, small 4 results) | |
$url = 'http://www.google.com/uds/GwebSearch?lstkp=0&rsz=' . $limit . '&hl=es&source=gsc&gss=.com&sig=fd25df5f26208aec5fddcae8457d8888&q=' . urlencode( $search ) . '&gl=www.google.com&qid=1253a7f078d655e6e&key=notsupplied&v=1.0'; | |
$data = file_get_contents( $url ); | |
$json = json_decode( $data ); | |
return $json->responseData->results; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>¡piedra, papel, tijeras con voz con html5!</title> | |
<meta charset="utf-8"/> | |
</head> | |
<body> | |
<style> | |
*{font-family:arial;font-size:20px;text-align:center} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// CONFIG | |
$access_token = ''; | |
$profile_ids = ''; | |
$limit = 1; | |
$urls = array( | |
'http://feeds.feedburner.com/betabeersjobs', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$names = "Ivan Garcia Villar | |
Alejandro Perezpaya | |
Asier Arranz Jimenez | |
Sergio Fernandez | |
Nestor Palao Pinedo | |
Jose Maria Martin | |
Raymond Albaladejo | |
Jose Antonio Lambiris Ruiz |
OlderNewer