Skip to content

Instantly share code, notes, and snippets.

Avatar

Ole Rößner Basster

View GitHub Profile
View emptyness-dependency-free.js
export default class Emptyness {
constructor(editor) {
this.editor = editor;
}
init() {
const doc = this.editor.model.document;
const view = this.editor.ui.view.editable;
@Basster
Basster / Collection.php
Last active Nov 8, 2018
Generate Collection and CollectionIterator for a PHP class. Inspired by https://github.com/sebastianbergmann/shaku
View Collection.php
<?php declare(strict_types=1);
#parse("PHP File Header.php")
namespace ${NAMESPACE};
final class ${CLASS}Collection implements \Countable, \IteratorAggregate
{
/**
* @var ${CLASS}[]
*/
View keybase.md

Keybase proof

I hereby claim:

  • I am basster on github.
  • I am basster (https://keybase.io/basster) on keybase.
  • I have a public key ASC9l5dwdWe8x45y7Q9e-W9pVd05iUvu349qthvp11hNqQo

To claim this, I am signing this object:

@Basster
Basster / cockpit.sh
Created Jan 24, 2018
Running Cockpit Kubernetes Edition as Docker Container
View cockpit.sh
#!/bin/sh
# usage: cockpit.sh start|stop
if [ "$1" = "start" ]; then
docker run -p 9090:9090 -e KUBERNETES_SERVICE_HOST=<kubernetes-cluster-ip> -e KUBERNETES_INSECURE=true -d cockpit/kubernetes
fi
if [ "$1" = "stop" ]; then
container=$(docker ps | grep cockpit/kubernetes | awk '{print $1}')
docker stop "$container"
View .mage.yml
magephp:
log_dir: ./temp
environments:
test:
user: debian
host_path: /home/debian/test.1001fonts.net
exclude:
- .docker/data
- .gitlab
- .platform
@Basster
Basster / symfony
Last active Nov 28, 2017
Docker-Compose Symfony Console
View symfony
#!/usr/bin/env bash
docker-compose run -u "$UID" -w /var/www/html --no-deps --rm php bin/console $@
View typeface-comments.js
import _ from 'lodash';
import React from 'react';
import ReactDOM from 'react-dom';
import Router from '../module/router';
import {api} from '../common/api';
import {Comment} from './comment';
import {Counter} from './counter';
import {TypefaceCommentForm} from './typeface-comment-form';
export class TypefaceComments extends React.Component {
View api.js
import $ from 'jquery';
import _ from 'lodash';
import Router from '../module/router';
export class Api {
getComments(typeface, callback) {
$.getJSON(Router.generate('typeface_comments', {'slug': typeface}), callback);
}
deleteComment(typeface, id, callback) {
@Basster
Basster / ServiceContainerTest.php
Created Jun 16, 2017
Class ServiceContainerTest boots up the kernel to test whether all service configurations are valid.
View ServiceContainerTest.php
<?php
declare(strict_types=1);
namespace Tests\DI;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Class ServiceContainerTest boots up the kernel to test whether all service configurations are valid.
*/
You can’t perform that action at this time.