Skip to content

Instantly share code, notes, and snippets.

View toin0u's full-sized avatar
🚀

Antoine Kirk toin0u

🚀
View GitHub Profile
Verifying that +toin0u is my blockchain ID. https://onename.com/toin0u
<?php
interface ProviderInterface
{
public function foo();
}
abstract class AbstractProvider implements ProviderInterface
{
public function bar()
@toin0u
toin0u / Redis.php
Created May 13, 2013 11:04
When PhpRedis is set up with an Redis::OPT_PREFIX, It does set the prefix to the key and to the timeout value. To set the resolved key in an array seems fixing this issue. @see: https://github.com/nicolasff/phpredis/issues/158
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->setOption(Redis::OPT_PREFIX, 'foo:');
$redis->sAdd('queues', 'my-queue');
// output: "SADD" "foo:queues" "my-queue"
$redis->blpop('queue:my-queue', 5);
<?php
/**
* This file is part of the Geocoder package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1">
<style type="text/css">
div { display: none; font-size: 15px; color: #FF0000; }
#title { display: block; color: #000000; }
/* iPhone 3 portrait */
<?php
require 'vendor/autoload.php';
$geocoder = new \Geocoder\Geocoder();
$adapter = new \Geocoder\HttpAdapter\SocketHttpAdapter();
$provider = new \Geocoder\Provider\GoogleMapsProvider($adapter);
$geocoder->registerProvider($provider);
try {
{
"dns" : [
{
"name" : "Google",
"ipv4" : [
"8.8.8.8",
"8.8.4.4"
]
},
{
{
"authenticationResultCode": "ValidCredentials",
"brandLogoUri": "http://dev.virtualearth.net/Branding/logo_powered_by.png",
"copyright": "Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
"resourceSets": [
{
"estimatedTotal": 1,
"resources": [
{
"__type": "Location:http://schemas.microsoft.com/search/local/ws/rest/v1",
@toin0u
toin0u / composer.json
Created February 22, 2015 22:22
DigitalOceanV2 with Guzzle 3.9
{
"require": {
"toin0u/digitalocean-v2": "0.5.*",
"guzzle/guzzle": "~3.9"
}
}
@toin0u
toin0u / composer.json
Created February 17, 2015 10:46
Flysystem ~1.0 + SFTP adapter
{
"require": {
"league/flysystem": "~1.0",
"league/flysystem-sftp": "~1.0"
}
}