Skip to content

Instantly share code, notes, and snippets.

View ylluminate's full-sized avatar

ylluminate ylluminate

View GitHub Profile

Contrived example demonstrating microgem dependencies

contrived is a microgem that depends on another microgem array_range, however gemspecs don't support DVCS dependencies. So how do we solve this without prematurely denting the universe?

Just use bundler.

Usage

Add all microgems to your project's Gemfile:

This is in reference to https://plus.google.com/105596541985629444566/posts/27y819XoT2V
to show simple steps I took to try and reproduce the described issue based upon the
information available. This is very simple benchmarking with an almost vanilla Rails 4
application using sqlite as the database so is not useful other than to demonstrate the
out of the box performance with TorqueBox and Trinidad under these situations is very
close.
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok, n1xim, pennedav, kabel)
Version: 0.2.0
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.2.0 0000-00-00 Updated page layout/styles and restructure code to be more MVC-like (kabel)
implemented HTTP Basic authentication (pennedav)

How to use swift in your terminal

setup

First, install Xcode 6 beta.

And run it.

sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer

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:

Run `rackup` then visit http://localhost:9292/stuff.js.
# Jubille started with:
# jubilee -p 8080 -e production
#
# Note that the Jubilee console outputs quite a few errors like below during
# the test:
#
# Jan 03, 2014 2:15:31 PM org.vertx.java.core.logging.impl.JULLogDelegate error
# SEVERE: Unhandled exception
# java.nio.channels.ClosedChannelException
#!/usr/bin/env ruby
require 'net/smtp'
module MailMachine
class NetSmtp < Net::SMTP
class << self
EXCEPTIONS = [Net::SMTPAuthenticationError,
Net::SMTPServerBusy,
Net::SMTPSyntaxError,
Net::SMTPFatalError,
#!/usr/local/bin/ruby -w
# some input examples
str = 'foo "bar baz" qux'
str = 'foo "bar baz " "bar baz" " bar baz" "bar "klr mre" " " \' "abc" \' baz " qux'
str = '" \' \' " \n " " \' \' "" foo \'ttt sss\' "bar "qqq zzz" baz" "added term" qux " \' \' " yyy xxx'
str = '"""frickin \'#{bar}\'"""'
str = '"" "frickin chicken " #{bar}""""'
str = '"""frickin "#{bar}""""'
str = '"a "b c" "d "e" f g" """h""""' # cf. http://snippets.dzone.com/posts/show/4852
@ylluminate
ylluminate / -
Created September 24, 2013 05:59
test