Skip to content

Instantly share code, notes, and snippets.

View egobude's full-sized avatar
😀
happy programmer

Benedikt Schmitz egobude

😀
happy programmer
  • ROSE Bikes GmbH
  • Bocholt, Germany
View GitHub Profile
@egobude
egobude / gist:762f94b8ae7736d10ed60274694cea0f
Created October 20, 2017 12:31 — forked from nvanselow/gist:3c6fe71bef68554b1bb0
Codeception, Laravel, and PhantomJS

You can use Codeception to test Javascript, like DOM manipulations and Ajax requests. Out of the box it can manipulate DOM elements but can't execute Javascript code, like most testing frameworks. But it gives you the option to use a WebDriver, to connect to a headless browser, and mimic a user browsing your website. It gives you some options: Selenium2, ZombieJS and, the easiest to configure, PhantomJS.

This article covers the installation and usage of PhantomJS, and assumes you are using Laravel Homestead, but it will work on any relatively new Debian based distro, like Ubuntu 14.04.

###Install PhantomJS

Just run those commands to install it:

sudo apt-get update
@egobude
egobude / adas
Created August 28, 2017 10:32
Test
dadasd
@egobude
egobude / 01-gulpfile.js
Created July 12, 2017 08:03 — forked from markgoodyear/01-gulpfile.js
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
<?php
namespace Acme\Bundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
@egobude
egobude / docker-compose.yml
Created April 26, 2017 14:56
Rancher - Load Balancer Setup
version: '2'
services:
nginx:
image: docker-registry.avency.de:5000/avency/nginx:1.11-alpine
stdin_open: true
volumes:
- /docker/nginx-phpfpm/data:/data
- /docker/nginx-phpfpm/nginx.conf:/etc/nginx/nginx.conf
- /docker/nginx-phpfpm/default.conf:/etc/nginx/conf.d/default.conf
tty: true
@egobude
egobude / release.php
Created April 19, 2017 14:18
[WIP] Git Release Script
#!/usr/bin/env php
<?php
/**
* updateComposerManifest
*/
#function updateComposerManifest($version = null) {
# $composerManifest = print_r(json_decode(file_get_contents('composer.json'), true));
# if (isset($composerManifest['version']) {
@egobude
egobude / install-rancher-compose.sh
Created February 14, 2017 18:36 — forked from jeefy/install-rancher-compose.sh
Rancher Compose Install Script
#!/bin/bash
# To run locally: ` curl -s https://gist.githubusercontent.com/jeefy/7fed19a335d5caae24639e7ee7be1b71/raw/install-rancher-compose.sh | sh `
VERSION_NUM="0.9.2"
wget https://github.com/rancher/rancher-compose/releases/download/v0.9.2/rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
tar zxf rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
rm rancher-compose-linux-amd64-v${VERSION_NUM}.tar.gz
sudo mv rancher-compose-v${VERSION_NUM}/rancher-compose /usr/local/bin/rancher-compose
@egobude
egobude / snippets.md
Last active August 3, 2017 06:31
Snippets

Every Day Snippets

tcpdump

Listen on pings

$ tcpdump -i any icmp

Listen on any interface and port 5683

@see: https://issues.jenkins-ci.org/browse/JENKINS-24338
cat /etc/sysconfig/docker
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
DOCKER="/usr/bin/docker"
0
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS=' --host=unix:///var/run/docker.sock --restart=false -g /opt/app/jenkins/docker -G jenkins'
@egobude
egobude / Caches.yaml
Created February 2, 2016 13:17
Flow Framework Redis Cache
Flow_Core:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions:
defaultLifetime: 0
hostname: '127.0.0.1'
port: '6379'
Flow_Monitor:
backend: TYPO3\Flow\Cache\Backend\RedisBackend
backendOptions: