Skip to content

Instantly share code, notes, and snippets.

View koenpunt's full-sized avatar
:octocat:
...

Koen Punt koenpunt

:octocat:
...
View GitHub Profile
@koenpunt
koenpunt / sass-mixins-to-css.md
Last active December 2, 2015 22:54
Sass mixins to plain CSS

Some regular expressions to replace mixins for plain CSS

# search
@include (transition|transform|opacity|backface-visibility|box-sizing|box-shadow|user-select|background(?:-image)?)\((.*)\)
# replace
$1: $2

# search
@include (translate3d|rotate|translateX|translateY)\((.*)\)

replace

@koenpunt
koenpunt / setup-mailcatcher-upstart.md
Last active November 3, 2015 13:41
Setup MailCatcher with rbenv and upstart

Setup MailCatcher with upstart

Clone the mailcatcher repo to a directory, here I use ~/.mailcatcher.

git clone https://github.com/sj26/mailcatcher.git ~/.mailcatcher

Navigate to the directory and setup the dependencies:

@koenpunt
koenpunt / UIImageView+imageDimensions.swift
Created September 3, 2015 14:44
UIImageView extension for calculated UIImageSize
//
// UIImageView+imageFrame.swift
// Tindex
//
// Created by Koen Punt on 24-08-15.
// Copyright (c) 2015 Koen Punt. All rights reserved.
//
import UIKit
#!/bin/bash
# $Id: ldap_ssh_key.sh 138 2013-09-14 08:24:39Z jmorano $
#
# Check if the user is in the right group
# and afterwards retrieve the SSH public key from LDAP
# Logs directly in Syslog
#
#
# sshd_config for OpenSSH 6.2 or higher:
#

Put this code on the page where the form you want to track resides. Some other examples are currently passed around the web with varying quality. This is one that will work as long as your form tag has an id= or name attribute.

You don´t have to change this code to be able to track form abandonment in your shopping cart, order form or whatever form you want.

This sends events to Google Analytics when a user focuses somewhere not in a field after having focused on a input field. You won´t know for how long users focused on respective fields, or the actual conversion rate in the form using this, but it might be a start.

A tool that provides more insight both over time and per field, is Form Analytics wich helps you optimize your online forms. For instance, it measures dropout rate, average field input length, conversion rate and average time per field. All which provides great insights in the most overlooked, yet important part of you site.

Anyway, here´s the code:

@koenpunt
koenpunt / alias.sh
Created April 8, 2014 14:43 — forked from fcoury/alias.sh
#
# zsh function to start Foreman based on whether or not
# you have multiple Procfiles
#
# we are adopting this schema of having environment
# specific Procfiles:
#
# config/development.proc
# config/stage.proc
# config/production.proc
@koenpunt
koenpunt / 0_reuse_code.js
Created January 20, 2014 15:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@koenpunt
koenpunt / chosen-bootstrap.css
Last active March 11, 2023 01:01
Bootstrap 3.0 theme for Chosen
select.form-control + .chosen-container.chosen-container-single .chosen-single {
display: block;
width: 100%;
height: 34px;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: #555;
vertical-align: middle;
background-color: #fff;
@koenpunt
koenpunt / view-manager.js
Created February 21, 2013 14:28
Very asic view manager for Backbone.js
/**
*
* Basic view manager
*
* var viewManager = new ViewManager({
* container: '#container'
* });
*
**/