Skip to content

Instantly share code, notes, and snippets.

PeeHaa /
Created August 27, 2012 15:52
numbered lists
  1. test 1
  2. test 2
PeeHaa / SQL and PHP
Created April 11, 2012 20:48
SQL and PHP tutorial
View SQL and PHP


SQL and PHP tutorial


Why this tutorial?

PeeHaa / oauth1-sign.php
Created August 1, 2012 13:42
Oauth 1a signature example
View oauth1-sign.php
* Implementation of the oAuth1 signature spec: *
namespace Oauth1\Signature;
class TwitterSignature implements \Oauth\Signature
protected $signatureAlgorithm;
protected $httpMethod;
PeeHaa /
Created August 31, 2012 13:34
If I see one more question about arrays in PHP...

Arrays can be seen as lists which can hold information. Arrays in PHP can holds all types of values like scalar values, objects or even other arrays.

Declaring an initializing arrays

First lets see how we can declare an empty array:

$theArray = array();
PeeHaa / v1.php
Created June 29, 2017 14:53
v1 vs v2
View v1.php
public function appendResponse(Response $response)
try {
$events = \json_try_decode($response->getBody(), true);
} catch (DecodeErrorException $e) {
$this->logger->emergency('Failed to decode response body as JSON', ['exception' => $e]);
throw new DecodingFailedException('Failed to decode response body as JSON', $e->getCode(), $e);
PeeHaa / GitAmptest.php
Created January 8, 2017 12:28
GitAmpTest with mocks
View GitAmptest.php
<?php declare(strict_types = 1);
namespace ekinhbayar\GitAmpTests\Client;
use Amp\Artax\Client;
use Amp\Artax\ClientException;
use Amp\Artax\Response;
use Amp\Promise;
use Amp\Success;
use ekinhbayar\GitAmp\Client\RequestFailedException;
View gist:e316e1e0248bc592ac0990c49525d115
Time: 679 ms, Memory: 6.00MB
There was 1 error:
1) Amp\Dns\Test\IntegrationTest::testResolve
RuntimeException: Unknown error file getting key '\1'.
PeeHaa / so-golden
Created June 28, 2015 19:38
old army guy with 100 years of dev experience
View so-golden
I'm voting to close this question as off-topic because it has nothing to do with programming – PeeHaa 1 hour ago
Excuse me, but although I AM a programmer, for the past 35 YEARS, and a very experienced one at that, IT TAKES programming to figure this out. So, using apt-get update and apt-get INSTALL doesn't work to fix the problem. SO, excuse, me, but where else can I go to find a solution except the best place on the web for questions. NOT every question MUST deal with PROGRAMMING or perhaps, there "IS" a programming feature I NEED to do, through TERMINAL to "light up" the ethernet port. I AM 54 years old and need a solution. Instead of VOTING to destroy this question, how about we find a solution. – Peter 22 mins ago
BTW, we're ALL programmers here.... perhaps a bit of thinking together, vice VOTING my question OUT the window would be more of a prudent solution, don't you all think? We do that together in a real world work environment. How intelligent would it be if we simply told
PeeHaa / CustomEtsy.php
Created December 19, 2013 18:01
Etsy is being a dickhead with its non standard scope implementation. What a dick move
View CustomEtsy.php
use OAuth\OAuth1\Service\Etsy;
use OAuth\OAuth1\Signature\SignatureInterface;
use OAuth\Common\Consumer\CredentialsInterface;
use OAuth\Common\Http\Uri\UriInterface;
use OAuth\Common\Storage\TokenStorageInterface;
use OAuth\Common\Http\Client\ClientInterface;
class CustomEtsy extends Etsy
PeeHaa / mail-regex-tester.php
Created August 8, 2013 10:12
Emailaddress regex pattern tester
View mail-regex-tester.php
if (isset($_POST['submit'])) {
$html = file_get_contents('');
$dom = new DOMDocument();
//$results = $dom->getElementById('results');