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
If I had the time, I'd make a rhyme |
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 | |
ini_set('user_agent', "PHP"); // github requires this | |
$api = 'https://api.github.com'; | |
$url = $api . '/users/lornajane/gists'; | |
// make the request | |
$response = file_get_contents($url); | |
// check we got something back before decoding |
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 | |
include "github-creds.php"; // sets $access_token | |
ini_set('user_agent', "PHP"); // github requires this | |
$api = 'https://api.github.com'; | |
$url = $api . '/gists'; // no user info because we're sending auth | |
// prepare the body data | |
$data = json_encode(array( |
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 | |
include "github-creds.php"; // sets $access_token | |
ini_set('user_agent', "PHP"); // github requires this | |
$api = 'https://api.github.com'; | |
$url = $api . '/gists/5501496'; // URL of the specific gist | |
// prepare the body data | |
$data = json_encode(array( |
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
Average time to run bench.php on my laptop, by PHP version | |
• 5.2.17: 3.77 seconds | |
• 5.3.23: 2.63 seconds | |
• 5.4.15: 1.98 seconds | |
• 5.5RC1: 2.11 seconds |
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 makeImgTag($src) { | |
return "<img src=\"" . $src . "\" />"; | |
} |
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 | |
class Message | |
{ | |
public function __construct($msg, $user) { | |
$this->msg = $msg; | |
$this->user = $user; | |
$this->created = new DateTime(); | |
} |
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
$ gradle build | |
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar | |
FAILURE: Build failed with an exception. | |
* What went wrong: | |
A problem occurred configuring root project 'android-app'. | |
> Could not resolve all dependencies for configuration ':_debugCompile'. | |
> Could not find com.android.support:appcompat-v7:22.2.0. | |
Searched in the following locations: |
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
Some riveting text |
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
Some riveting text |