Last active
December 10, 2015 12:19
-
-
Save devyfriend/4433561 to your computer and use it in GitHub Desktop.
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
/* search twitter hash */ | |
url: http://search.twitter.com/search.json?page=6&max_id=286412943002836992&q=%23GALAXYCamHoliday&rpp=99&include_entities=1&result_type=mixed | |
docs: https://dev.twitter.com/docs/api/1/get/search | |
/* twitter user */ | |
https://api.twitter.com/1/users/lookup.json?screen_name=devyfriend&include_entities=true | |
/* fb share */ | |
function posttofb(){ | |
var lnk = encodeURI('http://fb.camp-apps.com/g2/simpati/loop/preview/5'); | |
var img = encodeURI('http://fb.camp-apps.com/g2/simpati/loop_upload/gallery/1366054745.png'); | |
var capt = escape('G5 Warrior'); | |
var dsc = escape('Apa aja boleh'); | |
location.href='https://www.facebook.com/dialog/feed?app_id=361120683990059&link='+lnk+'&picture='+img+'&name=simPATI LOOP&caption='+capt+'&description='+dsc+'&redirect_uri='+lnk; | |
} | |
/* tw share */ | |
function posttotw(){ | |
var txt = escape('G5 Warrior'); | |
var url = encodeURI('http://fb.camp-apps.com/g2/simpati/loop/preview/5'); | |
location.href='http://twitter.com/share?text='+txt+'&url='+url; | |
} | |
/* check ip range */ | |
http://checkip.narak.com/index.cgi?domain_name=202.77.98.34 | |
$range_start = ip2long("114.120.0.0"); | |
$range_end = ip2long("114.126.255.255"); | |
$ip = ip2long($this->input->ip_address()); | |
if ($ip >= $range_start && $ip <= $range_end) return true; | |
/* ci pagination limit and page */ | |
function index($page=0){ | |
$limit = $conf['per_page']; | |
$page = $limit * (($page > 1) ? --$page : $page); | |
$this->db->limit($limit,$page); | |
} | |
/* nginx codeigniter remove index.php -- htaccess alike */ | |
error_page 404 /index.php; | |
location / { | |
if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){ | |
root home/$2/public_html; | |
access_log logs/$2-access.log main; | |
} | |
if (!-e $request_filename){ | |
rewrite ^(.*)$ /index.php?/$1 break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment