This file contains 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
$mobileID = 0; | |
if ((string)$mobileID == 'beta') { | |
error_log("shit bricks: " . $mobileID); | |
} | |
... | |
php test.php |
This file contains 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
window.gotStatus = function (s) { | |
console.log(s); | |
//feel free to do whatever you want here | |
}; | |
//replace twttr.anywhere._getVersion(twttr.anywhere._config.defaultVersion) with your version (ex. 1.1.3) if you want | |
function getStatus() { | |
twttr.anywhere({version: twttr.anywhere._getVersion(twttr.anywhere._config.defaultVersion), currentUser: twttr.anywhere.currentUser}, function (T) { | |
if (!T.isConnected()) { | |
if (!T.boundAuth) { | |
T.boundAuth = true; |
This file contains 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
/* | |
The following example shows how to correct detect connection status under php-cgi | |
Works under apache and nginx. Cannot get it to work under lighttpd. | |
*/ | |
ignore_user_abort(true); | |
ob_implicit_flush(true); //put these at the beginning | |
//loop and keep doing something until the user aborts | |
while (true) { |
This file contains 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
request.connection.addListener('end', function () { | |
response.end(); | |
}); | |
request.connection.addListener('close', function () { | |
response.end(); | |
}); |
This file contains 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 getIP(req) { | |
var ip_address = (req.connection.remoteAddress ? req.connection.remoteAddress : req.remoteAddress); | |
//check for cloudflare | |
try { | |
if (req.headers['cf-connecting-ip']) { | |
var ipParts = ip_address.split("."); | |
var cloudFlare = false; | |
switch (parseInt(ipParts[0])) { | |
case 204: | |
//(204.93.177.0 - 204.93.177.255) |
This file contains 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
/* | |
This is assuming you don't delete text messages. This only counts the amount of text messages you have not deleted. | |
This may take 5 minutes or so, depending on your computer speed and how many text messages you have. | |
Instructions: | |
Visit: https://www.google.com/voice/b/0#sms/ and wait for the page to fully load. | |
Paste this into your Javavscript console, wait it stops and look at the last count. |
This file contains 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(element, addCallback, removeCallback) { | |
if (element) { | |
//adding support for DOM events on remove and adding children | |
if (addCallback && element.appendChild) { | |
(function() { | |
var orig = element.appendChild; | |
element.appendChild = function() { | |
try { | |
orig.apply(this, arguments); | |
} catch(e) { //ie7,6 |
This file contains 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
var net = require("net"), | |
sys = require('util'), | |
socket = new net.connect(80, '74.125.115.99'); //google.com | |
socket.timedOut = false; | |
socket.setTimeout(1000, function() { | |
console.log("setTimeout(0) failed. Timed out!"); | |
socket.timedOut = true; | |
}); | |
socket.setTimeout(0); |
This file contains 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
var common = require('../common'); | |
var assert = require('assert'); | |
var net = require('net'); | |
var util = require('util'); | |
var c2 = net.createConnection(9999, 'google.com'); | |
c2.on('connect', function() { | |
console.log("connected"); | |
assert.ok(true); | |
}); |
This file contains 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 is_assoc($arr) { | |
return !(is_array($arr) && count(array_filter(array_keys($arr),'is_numeric')) == count($arr)); | |
} |
OlderNewer