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 | |
/** | |
* imageColor | |
* | |
* Shows three methods to find the 'average' image color. | |
* | |
* Each function expects a gd image object. | |
* | |
* imageColor::averageResize($image) resizing to 1px, and checking the color. | |
* imageColor::averageBorder($image) find the average color of all border pixels. |
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 | |
$ch = curl_init("http://api.drop.io/drops"); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, array('version' => '2.0', 'api_key' => 'API_KEY')); | |
$return = curl_exec($ch); | |
$xml = new SimpleXMLElement($return); | |
?> | |
<Response> |
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 | |
$to = LIST_ADDRESS; | |
$from = SENDER; | |
$rss = 'http://chileoutreach.posterous.com/rss.xml'; | |
$client = new Zend_Http_Client($rss); | |
$response = $client->request(); | |
if(($status = $response->getStatus()) !== 200){ |
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 | |
#I am not a bash scripter, this is my feeble attempt to create | |
#a drop.io cli uploader by cobbling together various ideas found | |
#on the internet. Perhaps someone will see this and say, "Silly | |
#bash script n00b, I'll show you how it's done." | |
# | |
#That's fine by me. | |
drop() |
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_once 'Zend/Controller/Action/Helper/Abstract.php'; | |
require_once 'Zend/Controller/Action/HelperBroker.php'; | |
require_once 'Zend/Session/Namespace.php'; | |
/** | |
* This helper tracks the user's browsing history | |
* | |
* @copyright 2008 Jani Hartikainen <www.codeutopia.net> | |
* @author Jani Hartikainen <firstname at codeutopia net> |
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
#!/usr/bin/env python | |
import string, re | |
from calibre.web.feeds.news import BasicNewsRecipe | |
from calibre.ebooks.BeautifulSoup import Tag, NavigableString | |
class Doctrine2(BasicNewsRecipe): | |
title = 'Doctrine2' |
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 getUser($name){ | |
$user = simplexml_load_file('http://twitter.com/users/show.xml?screen_name='.$name); | |
return $user; | |
} | |
$user = getUser('tjlytle'); | |
echo $user->followers_count; | |
echo $user->status->text; |
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
$token = new Zend_Oauth_Token_Access(); | |
$token->setToken(TWITTER_USER) | |
->setTokenSecret(TWITTER_PASS); | |
$twitter = new Zend_Service_Twitter(array( | |
'accessToken' => $token, | |
'consumerKey' => TWITTER_CONSUMER_KEY, | |
'consumerSecret' => TWITTER_CONSUMER_SECRET)); |
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 | |
$in = fopen($argv[1], 'r'); | |
$out = fopen('php://output', 'w'); | |
$fields = fgetcsv($in); | |
$map['date'] = 'Date'; | |
$map['description'] = 'Description'; | |
$map['payee'] = 'Employer'; | |
$map['amount'] = 'Amount'; |
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_once 'client.php'; //setup the Twilio rest client and assorted vars | |
$number = '1235556789'; //the number you're calling | |
$data = array('From' => $callerID, | |
'To' => $number, | |
'Url' => "http://twimlets.com/message?Message%5B0%5D=Voicemail&"); | |
//place both calls | |
$call1 = $client->request("$version/Accounts/$accountSid/Calls", 'POST', $data); |
OlderNewer