Skip to content

Instantly share code, notes, and snippets.

Matthew Setter settermjd

View GitHub Profile
settermjd / CustomSelectElementWithFormElementManager.php
Created Apr 22, 2014
A simple example of creating a custom select element, using the FormElementManager to handle the external dependencies.
View CustomSelectElementWithFormElementManager.php
* Define the custom form element
namespace Forecaster\Form\Element;
use Zend\Form\Element\Select;
use Zend\InputFilter\InputProviderInterface;
use Zend\Validator\Db\RecordExists;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
settermjd / nginx owncloud config
Created Sep 3, 2014
A configuration of nginx for ownCloud (doesn't quite work yet)
View nginx owncloud config
server {
listen 80;
return 301 https://$server_name$request_uri; # enforce https
server {
listen 443 ssl;
root /home/vagrant/owncloud;
View gist:762e3297639d8e9e8675
// The following is a route to simplify getting started creating
// new controllers and actions without needing to create a new
// module. Simply drop new controllers in, and you can access them
// using the path /application/:controller/:action
'application' => array(
'type' => 'Literal',
'options' => array(
'route' => '/application',
'defaults' => array(
'__NAMESPACE__' => 'Application\Controller',
settermjd / gist:b9f4c875c252c587e737
Created Feb 26, 2015
Attempting to know if the following examples are effectively the same thing
View gist:b9f4c875c252c587e737
* Are these two examples the same, with the second just being more verbose?
import static spark.Spark.*;
public class HelloWorld {
public static void main(String[] args) {
get("/hello", (req, res) -> "Hello World");
settermjd / spark-service
Created Mar 2, 2015
A simple chkconfig script to manage starting and stopping the Maven/Jetty server, which supports a SparkJava application
View spark-service
#! /bin/bash
# spark-service Start/Stop the Maven Jetty process
# chkconfig: 235 90 60
# description: This will manage the starting and stopping of the Maven/Jetty
# server which will render the SparkJava application. It's
# rather simple, so don't expect miracles of it.
node winston.query.js | tr "[{:,'" ' ' | tr -s " " | awk '/country/ { print $2 }' | sort | uniq | wc -l | tr -s " "
settermjd / group-by-in-zend-db.php
Last active Aug 29, 2015
Joining equal values​​, that were returned from a database
View group-by-in-zend-db.php
* The following code builds this query:
* SELECT `amount`
* , GROUP_CONCAT(`Name` SEPARATOR ', ') AS `name`
* FROM `table`
* GROUP BY `amount`
* ORDER BY `amount` DESC
* LIMIT 0, 3
public function getSome()
View ZF2 Setup.php
* This class allows the Controller to be instantiated as a factory by the ServiceManager
namespace BabyMonitor\Controller\Factories;
use Zend\ServiceManager\FactoryInterface,
settermjd / Building a Virtual
Last active Aug 29, 2015
Building a Virtual Business
View Building a Virtual

Ever dreamed of being your own boss? We often think that building a business involves a lot of money and time (and it does). There are also innumerable software applications to handle countless day-to-day processes; whether that's accounting, project management, time tracking, and so on.

In reality however, its not that difficult to spin up infrastructure to support routine business tasks. Whether you're starting out as a freelancer, or building a fully-fledged business, replete with employees and payroll, there are services and apps to help.

In this session, I'll show you the key applications you need to start and build a successful business, on a virtual shoestring. Along the way, I'll share what I've learned building my own programming and writing business, when it comes to working with clients, getting paid, and managing projects and tasks.

You can’t perform that action at this time.