Skip to content

Instantly share code, notes, and snippets.

View frederikbosch's full-sized avatar

Frederik Bosch frederikbosch

View GitHub Profile
@frederikbosch
frederikbosch / XmppLogger
Last active August 29, 2015 14:15
Xmpp Logger Monolog
<?php
use Monolog\Handler\AbstractProcessingHandler;
use Fabiang\Xmpp\Client;
use Fabiang\Xmpp\Options as XmppOptions;
use Fabiang\Xmpp\Protocol\Roster;
use Fabiang\Xmpp\Protocol\Presence;
use Fabiang\Xmpp\Protocol\Message;
use Monolog\Logger;
class XmppLogger extends AbstractProcessingHandler {
<?php
$url = 'http://packagist.org/p/symfony/finder$a4bc31ef5d391952af0e7202b072f6d587ae89623277f89aefad0f9d49a9bc2c.json';
$headers = array(
'User-Agent: Composer/source (Windows NT; 6.2; PHP 5.6.5)',
'Accept-Encoding: gzip',
'Connection: close',
);
<?php
$url = 'http://packagist.org/p/symfony/finder$a4bc31ef5d391952af0e7202b072f6d587ae89623277f89aefad0f9d49a9bc2c.json';
$headers = array(
'User-Agent: Composer/source (Windows NT; 6.2; PHP 5.6.5)',
'Accept-Encoding: gzip',
'Connection: close',
);
array(10) {
'wrapper_data' =>
array(9) {
[0] =>
string(15) "HTTP/1.1 200 OK"
[1] =>
string(13) "Server: nginx"
[2] =>
string(35) "Date: Wed, 24 Jun 2015 10:18:15 GMT"
[3] =>
<?php
$url = 'http://packagist.org/p/symfony/finder$a4bc31ef5d391952af0e7202b072f6d587ae89623277f89aefad0f9d49a9bc2c.json';
$url = 'http://dump.robbast.nl/finder$a4bc31ef5d391952af0e7202b072f6d587ae89623277f89aefad0f9d49a9bc2c.json';
$headers = array(
'User-Agent: Composer/source (Windows NT; 6.2; PHP 5.6.5)',
'Accept-Encoding: gzip',
'Connection: close',
);
@frederikbosch
frederikbosch / zlib_test.php
Created June 25, 2015 08:32
Test from both servers
<?php
function download ($url) {
$headers = array(
'User-Agent: Composer/source (Windows NT; 6.2; PHP 5.6.5)',
'Accept-Encoding: gzip',
'Connection: close',
);
$options = array(
import Ember from "ember";
var RSVP = Ember.RSVP;
export default function () {
if (!this.newElement) {
return RSVP.resolve();
} else if (!this.oldElement) {
this.newElement.css({visibility: ''});
return RSVP.resolve();
}
import Ember from "ember";
var RSVP = Ember.RSVP;
export default function () {
if (!this.newElement) {
return RSVP.resolve();
} else if (!this.oldElement) {
this.newElement.css({visibility: ''});
return RSVP.resolve();
}
<?php
namespace Omnipay\Common;
class Money {
private $value;
private $currencyCode;
private function __construct ($value, $currencyCode) {
$this->value = $value;
<?php
namespace Omnipay\Common;
class Money {
private $value;
private function __construct ($value) {
$this->value = $value;
}