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
String.prototype.linkify = function() { | |
return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) { | |
return m.link(m); | |
}); | |
}; |
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 twitterCallback2(twitters) { | |
var statusHTML = []; | |
for (var i=0; i<twitters.length; i++){ | |
var username = twitters[i].user.screen_name; | |
var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { | |
return '<a href="'+url+'">'+url+'</a>'; | |
}).replace(/\B@([_a-z0-9]+)/ig, function(reply) { | |
return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>'; | |
}); | |
statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id+'">'+relative_time(twitters[i].created_at)+'</a></li>'); |
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
<?php | |
// FizzBuzz | |
for ($i = 1; $i <= 100; $i++) | |
{ | |
if ($i % 15 == 0) | |
print "FizzBuzz"; | |
elseif ($i % 3 == 0) | |
print "Fizz"; | |
elseif ($i % 5 == 0) | |
print "Buzz"; |
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 _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-xxxxxxx-x']); | |
_gaq.push(['_trackPageview']); | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
})(); |
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
const timelib_tzdb_index_entry timezonedb_idx_builtin[565] = { | |
{ "Africa/Abidjan" , 0x000000 }, | |
{ "Africa/Accra" , 0x000055 }, | |
{ "Africa/Addis_Ababa" , 0x0000FD }, | |
{ "Africa/Algiers" , 0x000153 }, | |
{ "Africa/Asmara" , 0x00027E }, | |
{ "Africa/Asmera" , 0x0002D4 }, | |
{ "Africa/Bamako" , 0x00032A }, | |
{ "Africa/Bangui" , 0x000395 }, | |
{ "Africa/Banjul" , 0x0003EA }, |
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
for (i=0;i<11;i++){ | |
setTimeout(function(x){return function(){alert(x)};}(i),1000); | |
} | |
function(x){return function(){alert(x)};}(i) | |
function func(x) {return function(){alert(x)};} // defines the function | |
func(i); // runs the function |
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
500 INTERNAL SERVER ERROR | |
Sorry, something went wrong. | |
A team of highly trained monkeys has been dispatched to deal with this situation. | |
Also, please include the following information in your error report: |
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
# Remove Excess White Space | |
preg_replace('/\s+/xms', ' ', trim($str)) |
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 RandomNumber(n1,n2){ | |
return(Math.floor(Math.random()*(n2-n1))+n1); | |
} | |
n=RandomNumber(20,80); |
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
X-FRAME-OPTIONS: DENY (or SAMEORIGIN) | |
X-Content-Security-Policy: allow 'self'; frame-ancestors 'none' |