Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
happy programmer

Benedikt Schmitz egobude

😀
happy programmer
  • ROSE Bikes GmbH
  • Bocholt, Germany
View GitHub Profile
View gist:762f94b8ae7736d10ed60274694cea0f

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
View 01-gulpfile.js
/*!
* 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'),
View Crawler
<?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 Apr 26, 2017
Rancher - Load Balancer Setup
View docker-compose.yml
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 Apr 19, 2017
[WIP] Git Release Script
View release.php
#!/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 Feb 14, 2017 — forked from jeefy/install-rancher-compose.sh
Rancher Compose Install Script
View install-rancher-compose.sh
#!/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
View snippets.md

Every Day Snippets

tcpdump

Listen on pings

$ tcpdump -i any icmp

Listen on any interface and port 5683

View Jenkins Docker Configuration
@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 Feb 2, 2016
Flow Framework Redis Cache
View Caches.yaml
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: