Skip to content

Instantly share code, notes, and snippets.

View dimitri-koenig's full-sized avatar

Dimitri König dimitri-koenig

View GitHub Profile
@dimitri-koenig
dimitri-koenig / count.js
Last active August 29, 2015 14:09 — forked from clouddueling/bookmarklet.js
Count AngularJS Watchers
(function() {
var root = $(document.getElementsByTagName('body'));
var watchers = [];
var f = function(element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function(watcher) {
watchers.push(watcher);
});
}
angular.forEach(element.children(), function(childElement) {
@dimitri-koenig
dimitri-koenig / magento-nginx.conf
Created December 11, 2015 21:05 — forked from gwillem/magento-nginx.conf
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
}
Stability ratings: 0-5
0 - Deprecated. This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
1 - Experimental. This feature was introduced recently, and may change
or be removed in future versions. Please try it out and provide feedback.
If it addresses a use-case that is important to you, tell the node core team.

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.

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
@dimitri-koenig
dimitri-koenig / Alert.vue
Created September 6, 2016 10:24 — forked from martinlindhe/Alert.vue
jasmine + karma for vue test
<style>
.Alert {
padding: 2em;
}
.Alert-Success {
border: 10px solid green;
}
.Alert-Error {
border: 10px solid red;
}
@dimitri-koenig
dimitri-koenig / gulpfile.js
Created February 17, 2017 17:14 — forked from bigsweater/gulpfile.js
Sage gulpfile with Browserify Hot Module Reloading, sourcemaps, and asset revisioning
/* eslint-disable */
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
@dimitri-koenig
dimitri-koenig / flexform.xml
Created April 13, 2017 14:36 — forked from alrnz/flexform.xml
TypoLink in flexform for TYPO3 7.6
<settings.link>
<TCEforms>
<exclude>1</exclude>
<label>
Link to Page or a File or a Content-Element
</label>
<config>
<type>input</type>
<size>30</size>
<eval>trim</eval>
@dimitri-koenig
dimitri-koenig / gist:e21c9ca68f127554c2dc0e6a665c3a34
Created May 22, 2017 18:33 — forked from micronax/gist:6319186
Alle Shopware-Artikel aus der Datenbank entfernen + Media-DB für Artikel leeren. Achtung: Artikelbilder müssen noch manuell vom Server entfernt werden /media/img/
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `s_articles`;
TRUNCATE TABLE `s_articles_attributes`;
TRUNCATE TABLE `s_articles_categories`;
TRUNCATE TABLE `s_articles_categories_ro`;
TRUNCATE TABLE `s_articles_details`;
TRUNCATE TABLE `s_articles_img`;
TRUNCATE TABLE `s_articles_prices`;
TRUNCATE TABLE s_article_configurator_sets;
TRUNCATE TABLE s_article_configurator_set_group_relations;
@dimitri-koenig
dimitri-koenig / ICS.php
Last active July 10, 2017 09:42 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* ICS.php
* =======
* Use this class to create an .ics file.
*
* Usage
* -----
* Basic usage - generate ics file contents (see below for available properties):