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 barras() { | |
$this->load->library('phpgraphlib'); | |
$graph = new PHPGraphLib(350,200); | |
for ($j=1;$j<=$total;$j++) { | |
$graph->addData($data[$j]); | |
} | |
$graph->setBars(false); | |
$graph->setLine(true); |
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 pie() { | |
$this->load->library('phpgraphlib'); | |
$this->load->library('phpgraphlibpie'); | |
$graph = new PHPGraphLibPie(330, 240); | |
var $data = array(); //Lo llenan con json, xml, mysql, etc | |
$graph->addData($data); | |
//El name lo obtienen de alguna consulta | |
$graph->setTitle('Menciones por #Hashtag : '.utf8_decode($name).''); | |
$graph->setTextColor("blue"); |
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 auth() | |
{ | |
$tokens = $this->tweet->get_tokens(); | |
$user = $this->tweet->call('get', 'account/verify_credentials'); | |
var_dump($user); | |
$friendship = $this->tweet->call('get', 'friendships/show', array('source_screen_name' => $user->screen_name, 'target_screen_name' => 'silvercorp')); | |
var_dump($friendship); |
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
#include <stdio.h> | |
#include <conio.h> | |
int main(void){ | |
int i,j; | |
int x[]={6,91,79,102,109,124,7,127,103,63}; | |
int y[]={119,124,57,94,121,113,125,118,6,14,56,63,115,109,62,110}; | |
clrscr(); | |
printf("Imprimiendo numeros\n"); | |
for (j=0;j<=9;j++){ |
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 search($term) { | |
$CI =& get_instance(); | |
date_default_timezone_set("America/Mexico_City"); | |
$limit = 25; | |
$searchresults = $CI->curl->simple_get("http://search.twitter.com/search.json?q='%40$term'&rpp=$limit"); | |
$searcharray = json_decode($searchresults, true); | |
foreach ($searcharray['results'] as $row) | |
{ | |
if (array_key_exists("from_user",$row)) { |
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
RewriteEngine On | |
RewriteCond% {} HTTP_HOST! ^ su-site.com $ [NC] | |
RewriteRule ^(.*)$ http://your-site.com/ $ 1 [L, R = 301] |
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 randomColor() { | |
$str = '#'; | |
for($i = 0 ; $i < 6 ; $i++) { | |
$randNum = rand(0 , 15); | |
switch ($randNum) { | |
case 10: $randNum = 'A'; break; | |
case 11: $randNum = 'B'; break; | |
case 12: $randNum = 'C'; break; |
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 postwall($publishdata) | |
{ | |
$CI =& get_instance(); | |
$CI->curl->create("https://graph.facebook.com/".$publishdata['uid']."/feed"); | |
$CI->curl->option('buffersize', 10); | |
$wallpost = array( | |
'access_token'=> $publishdata['access_token'], | |
'message' => $publishdata['message'], | |
'link' => $publishdata['link'], |
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 _puts3($filename,$type) | |
{ | |
$bucketfolder = 'full'; | |
$file = "/home/silvercorp/webapps/codejobs/tmp/".$filename; | |
$bucket = "silvercorp"; | |
$uri = $bucketfolder.'/'.$filename; | |
$put = S3::putObject(S3::inputFile($file), $bucket, $uri, S3::ACL_PUBLIC_READ, array(), array("Cache-Control" => "max-age=315360000","Expires" => gmdate("D, d M Y H:i:s T", strtotime("+5 years"))) ); | |
if(!$put) { |
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
% Displaying a binary tree. | |
% show( Tree): display binary tree | |
show( Tree) :- | |
show2( Tree, 0). | |
% show2( Tree, Indent): display Tree indented by Indent | |
show2( nil, _). |