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 | |
| /* | |
| * twitter.min.php | |
| * Copyright (c) 2009 Justin Poliey <jdp34@njit.edu> | |
| * Licensed under the MIT License | |
| * | |
| * This piece of software was inspired by Travis Dent's php-twitter | |
| * http://github.com/tcdent/php-twitter | |
| * | |
| * Using this is insanely simple. You just need to map methods just |
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
| from bot import TCGBot | |
| from tcg import Player, Card | |
| import sets | |
| import sys, random, copy, sqlite3, irclib | |
| db = None | |
| def dispatch(irc, nick, address, cmd): | |
| sql = db.cursor() | |
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
| body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { | |
| margin:0; | |
| padding:0; | |
| } | |
| table { | |
| border-collapse:collapse; | |
| border-spacing:0; | |
| } | |
| fieldset,img { | |
| border:0; |
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 | |
| // require glue lib | |
| require 'glue.php'; | |
| // create a glue object, and look up the neverending story in json format | |
| // $glue->$method->$chain maps to api calls, like method/chain | |
| // you can use any value, but glue will throw errors | |
| $glue = new Glue('username', 'password'); | |
| $response = $glue->object->get(array( | |
| 'objectId' => 'http://en.wikipedia.org/wiki/The_Neverending_Story', |
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 | |
| /* | |
| * TYPICAL RESULT | |
| * Redisent completed in 1.507806 seconds | |
| * Redis completed in 1.575556 seconds | |
| */ | |
| error_reporting('E_ALL | ~E_NOTICE'); | |
| require 'redis.php'; |
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 next_highest($needle, $haystack) { | |
| foreach ($haystack as $id => $handful) { | |
| if ($needle < $handful) { | |
| return $haystack[($id == 0) ? count($haystack)-1 : $id-1]; | |
| } | |
| } | |
| return $haystack[0]; | |
| } |
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 | |
| if ($session->check('Message.auth')) { | |
| $session->flash('auth'); | |
| } | |
| echo $form->create('User', array('action'=>'login')); | |
| echo $form->input('email'); | |
| echo $form->input('password'); | |
| echo $form->end('Login'); | |
| ?> |
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
| # $ tweet Hi mom! | |
| # | |
| # Put this in ~/.bashrc or wherever. | |
| # If it doesn't work, make sure your ~/.netrc is right | |
| # | |
| # (Thanks to @anildigital and @grundprinzip for curl-fu) | |
| function tweet { | |
| curl -n -d status="$*" https://twitter.com/statuses/update.xml --insecure &> /dev/null | |
| echo "tweet'd" |
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 $u=$_GET['u'];$l=$u();extract($l);include("view/{$u}.php"); |
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 | |
| require 'tessera.php'; | |
| class BasicApp extends Tessera { | |
| function index() { | |
| echo "Deep down, deep down, dadi dadu dadu dadi dada"; | |
| } | |
| } | |
| $basic = new BasicApp(array( |