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> | |
<body> | |
<?php | |
$img = 'http://www.saudigazette.com.sa/myfiles/Images/2012/12/18/li02.jpg'; | |
$type = pathinfo($img, PATHINFO_EXTENSION); | |
$data = file_get_contents($img); | |
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); | |
?> |
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 | |
function loadimg($img) | |
{ | |
//absolute path | |
$fullPath = '/private/'.$img; | |
if (is_readable($fullPath)) { | |
$mime = mime_content_type($fullPath); | |
header('Content-type: ' . $mime); | |
header('Content-length: ' . filesize($fullPath)); |
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
<html> | |
<head> | |
<title>Jquery Hashbang</title> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ></script> | |
<script type='text/javascript'> | |
$(document).ready(function() { | |
$.ajax({ | |
dataType: "json", | |
url: "https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=esolat&query=select%20*%20from%20%60solat%60%20limit%2010", | |
success: function(datas){ |
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
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz | |
tar xzvf GeoIP.tar.gz |
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
cd GeoIP* | |
./configure | |
make | |
make check | |
make install |
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
wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.7.tar.gz | |
tar zxvf mod_geoip2_1.2.7.tar.gz |
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
cd mod_geoip2_1.2.7 | |
apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c |
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
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
gunzip GeoIP.dat.gz |
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
mkdir /usr/src/geoip | |
mv GeoIP.dat /usr/src/geoip/ |
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
LoadModule geoip_module modules/mod_geoip.so | |
<IfModule mod_geoip.c> | |
GeoIPEnable On | |
GeoIPDBFile /usr/src/geoip/GeoIP.dat | |
</IfModule> |