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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers | |
var t_page = "westvirginiau"; // the account name for your main twitter account | |
function add_commas(number) { | |
if (number.length > 3) { | |
var mod = number.length % 3; |
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 $w = function(){ | |
var $w = function(){ | |
return new $w.init; | |
} | |
$w.prototype = { | |
// add all of the methods/props you want accessible as $w().method() or $w().prop here: | |
init: function(){ | |
console.log('init called'); | |
}, |
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 | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' ); | |
} | |
?>hi |
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 // Some lovely, valid php code that prints "foofoo" | |
echo${${($f='f').(${$o='o'}).${$o}}=${$f}.$${$$o}.$$${$$$o}}; | |
echo$$$$$$$$$$$$$$$$$$$$${(${(${(${(${(${($$$foo)})})})})})}; |
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 | |
/** | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any | |
* means. | |
* |
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 | |
// Set root url, which point to yahoo api | |
$root = 'http://query.yahooapis.com/v1/public/yql?format=json&diagnostics=true&callback=cbfunc'; | |
// Get title from google | |
$titleUrl = $root . '&q=' . urlencode("select content from html where url = 'http://google.com' and xpath = '//title'"); | |
// Get description from google | |
$descUrl = $root . '&q=' . urlencode("select content from html where url='http://google.com' and xpath = '//meta' and name='description'"); | |
// Process it |
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 | |
/******************************************************************************* | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php [L,QSA] | |
*******************************************************************************/ |
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 | |
function func_curry($fn) | |
{ | |
$args = array_slice(func_get_args(), 1); | |
return function() use ($fn, $args) { | |
$args = array_merge($args, func_get_args()); | |
return call_user_func_array($fn, $args); | |
}; |
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 | |
// pipes each function's return value as input into the next function in the chain | |
function func_compose() | |
{ | |
$fns = func_get_args(); | |
$composition = function() use ($fns) { | |
$input = func_get_args(); | |
foreach ($fns as $fn) { | |
$return = call_user_func_array($fn, $input); |
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
GitHub.TreeSlider = function () { | |
if (window.history && window.history.pushState) { | |
function a() { | |
if (e.sliding) { | |
e.sliding = false; | |
$(".frame-right").hide(); | |
$(".frame-loading:visible").removeClass("frame-loading") | |
} | |
} | |
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { |