Skip to content

Instantly share code, notes, and snippets.

View redpanda's full-sized avatar

Jimmy Leger redpanda

View GitHub Profile
@redpanda
redpanda / script.sh
Created March 12, 2018 17:15
minikube with calico
# start minikube
minikube start --vm-driver=hyperkit --extra-config=apiserver.Admission.PluginNames="Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota,PodPreset" --kubernetes-version=v1.9.0 -v 10 --network-plugin=cni --host-only-cidr 172.17.17.1/24 \
--extra-config=kubelet.PodCIDR=192.168.0.0/16 \
--extra-config=proxy.ClusterCIDR=192.168.0.0/16 \
--extra-config=controller-manager.ClusterCIDR=192.168.0.0/16
# install calico
curl -O -L https://docs.projectcalico.org/v2.4/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml
'use strict';
const { Service } = require('./lib');
const Joi = require('joi');
// plugins
const doc = require('./lib/service/plugins/doc');
const log = require('./lib/service/plugins/log');
const requestId = require('./lib/service/plugins/request-id');
<?php
$content = file_get_contents(__DIR__.'/Foo.php');
$namespaces = array();
preg_match_all('/^use ([^\s;]+)(?:\s+as\s+(.*))?;/m', $content, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$namespaces[] = $match[0];
}
@redpanda
redpanda / Hunspell.php
Created April 24, 2012 13:04
hunspell
<?php
namespace Hunspell;
class Hunspell
{
private $path;
private $language;
private $errors;
<?php
Class user{
public function getAge(){ return "25";}
}
?>
<?php
interface Timelineable
{
}
interface TimelinerInterface
{
public function supports($target);
public function getContent();
<?php
class Team
{
protected $name;
public function __construct($name)
{
$this->name = $name;
}
@redpanda
redpanda / Application.php
Created May 24, 2011 15:57
Custom Silex Application class
<?php
// ...
class Application extends \Pimple implements HttpKernelInterface, EventSubscriberInterface
{
/**
* Constructor.
*
* @param string $environment The environment
<?php
class IssueManager
{
private $objectManager;
private $issueRepository;
private $distpatcher;
public function __construct(objectManager, IssueRepository $issueRepository, EventDispatcherInterface $dispatcher)
{
// if no cli
if (0 != strncasecmp(PHP_SAPI, 'cli', 3)) {
// do something
}