Skip to content

Instantly share code, notes, and snippets.

View addshore's full-sized avatar
🏄

addshore

🏄
View GitHub Profile
@addshore
addshore / gist:1c5612b7aa358bb6ac25
Last active August 29, 2015 14:03
Opencorporates - Claim Creator
<?php
require_once( __DIR__ . "/vendor/autoload.php" );
// Set stuff up
$api = new \Mediawiki\Api\MediawikiApi( 'http://www.wikidata.org/w/api.php' );
$api->login( new \Mediawiki\Api\ApiUser( 'USERNAME', 'PASSWORD' ) );
$services = new \Wikibase\Api\WikibaseFactory( $api );
// Stuff we need for each item!
@addshore
addshore / gist:04863ade4960c5616135
Last active August 29, 2015 14:05
PHP Returning $this from __construct
// What can be done
class Foo {
function echo( $string ) {
echo $string;
return $this;
}
}
$foo = new Foo();
#!/usr/bin/env php
<?php
use Phergie\Irc\Bot\React\Bot;
use Phergie\Irc\Bot\React\EventQueueInterface as Queue;
use Phergie\Irc\Client\React\Client;
use Phergie\Irc\Client\React\WriteStream;
use Phergie\Irc\Connection;
use Phergie\Irc\ConnectionInterface;
use Phergie\Irc\Event\ServerEvent;

Keybase proof

I hereby claim:

  • I am addshore on github.
  • I am addshore (https://keybase.io/addshore) on keybase.
  • I have a public key whose fingerprint is 0A41 CF8D FB65 73F4 7FB1 FCC8 7ADD ABC3 E684 2FB3

To claim this, I am signing this object:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot PATH
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory PATH >
Options Indexes FollowSymLinks MultiViews
WITH
wikipedias AS (
SELECT
DISTINCT dbname
FROM wmf_raw.mediawiki_project_namespace_map
WHERE snapshot = '2018-02'
AND hostname LIKE '%wikipedia.org'
),
wikidata_editors AS (
apiVersion: apps/v1
kind: Deployment
metadata:
name: guids
labels:
app: guids
spec:
replicas: 2
selector:
matchLabels:
@addshore
addshore / gist:87acdbbc068768cc3457971f556b362d
Created June 9, 2018 08:43
Wikibase docker LocalSettings template logo example 09/06/2018
<?php
/**
* ----------------------------------------------------------------------------------------
* This file is provided by the wikibase/wikibase docker image.
* This file will be passed through envsubst which will replace "${DOLLAR}" with "$".
* If you want to change MediaWiki or Wikibase settings then either mount a file over this
* template and or run a different entrypoint.
* ----------------------------------------------------------------------------------------
*/
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-controller
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
<?php
echo "This is an example github gist...";