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 getIP() { | |
$ip; | |
if (getenv("HTTP_CLIENT_IP")) | |
$ip = getenv("HTTP_CLIENT_IP"); | |
else if(getenv("HTTP_X_FORWARDED_FOR")) | |
$ip = getenv("HTTP_X_FORWARDED_FOR"); | |
else if(getenv("REMOTE_ADDR")) | |
$ip = getenv("REMOTE_ADDR"); |
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 getQuerystring(key, default_) | |
{ | |
if (default_==null) default_=""; | |
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); | |
var qs = regex.exec(window.location.href); | |
if(qs == null) | |
return default_; | |
else | |
return qs[1]; |
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 curl_get($url, array $get = NULL, array $options = array()) | |
{ | |
$defaults = array( | |
CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). @http_build_query($get), | |
CURLOPT_HEADER => 0, | |
CURLOPT_RETURNTRANSFER => TRUE, | |
CURLOPT_TIMEOUT => 4 | |
); |
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 getStringpart($string,$startStr,$endStr) | |
{ | |
$startpos=strpos($string,$startStr); | |
$endpos=strpos($string,$endStr,$startpos); | |
$endpos=$endpos-$startpos; | |
$string=substr($string,$startpos,$endpos); | |
return $string; |
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 getTime() | |
{ | |
$a = explode (' ',microtime()); | |
return(double) $a[0] + $a[1]; | |
} | |
$Start = getTime(); | |
$End = getTime(); |
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 | |
/** | |
* @package {{PACKAGE}} | |
* @subpackage {{SUBPACKAGE}} | |
* @copyright Copyright (C) 2013 {{COPYRIGHT}}. All rights reserved. | |
* @license GNU General Public License version 2 or later when included with or used in the Joomla CMS. | |
*/ | |
// No direct access. | |
defined('_JEXEC') or die; |
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 replaceURLWithHTMLLinks(text) { | |
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; | |
return text.replace(exp,"<a href='$1'>$1</a>"); | |
} |
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 get_html_translation_table (table, quote_style) { | |
var entities = {}, | |
hash_map = {}, | |
decimal; | |
var constMappingTable = {}, | |
constMappingQuoteStyle = {}; | |
var useTable = {}, | |
useQuoteStyle = {}; | |
// Translate arguments |
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 getTweetTime(timestamp) | |
{ | |
var time = (Date.parse(timestamp)/1000); | |
time = Math.round((((new Date()).getTime() / 1000)-time)/60); | |
if (time >= 60) { | |
var hours = Math.round(time / 60); | |
if (hours == 1) { | |
return "sent " + hours + " hour ago"; |
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
#!/bin/bash | |
NO_DEV="--no-dev" | |
if [[ $1 == "dev" ]]; then | |
NO_DEV="" | |
fi | |
git fetch |
OlderNewer