It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
<?php | |
$collection = new Doctrine\Common\Collection\ArrayCollection(); | |
// add objects to the collection that contain a getCreated method returning a DateTime instance | |
$iterator = $collection->getIterator(); | |
$iterator->uasort(function ($first, $second) { | |
if ($first === $second) { |
It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.
I've also compiled a list of countries
This list served quite some people but someone else did a better job since.
Go to https://github.com/umpirsky/country-list for a list in your language and format.
I've also compiled a list of nationalities
<?php | |
/** | |
* @link http://jonathonhill.net/2012-05-18/unshorten-urls-with-php-and-curl/ | |
*/ | |
function unshorten_url($url) { | |
$ch = curl_init($url); | |
curl_setopt_array($ch, array( | |
CURLOPT_FOLLOWLOCATION => TRUE, // the magic sauce | |
CURLOPT_RETURNTRANSFER => TRUE, |
<?php | |
/* | |
+----------------------------------------------------------------------+ | |
| APC | | |
+----------------------------------------------------------------------+ | |
| Copyright (c) 2006-2011 The PHP Group | | |
+----------------------------------------------------------------------+ | |
| This source file is subject to version 3.01 of the PHP license, | | |
| that is bundled with this package in the file LICENSE, and is | | |
| available through the world-wide-web at the following url: | |
{% set terms_link %}<a title="{% trans %}Read the General Terms and Conditions{% endtrans %}" href="{{ path('get_general_terms_and_conditions') }}">{% trans %}General Terms and Conditions{% endtrans %}</a>{% endset %} | |
{% set general_terms_and_conditions %}{{ 'I have read and accept the %general_terms_and_conditions%.'|trans({ '%general_terms_and_conditions%': terms_link })|raw }}{% endset %} | |
<div> | |
{{ form_errors(form.acceptGeneralTermsAndConditions) }} | |
{{ form_widget(form.acceptGeneralTermsAndConditions) }} | |
<label for="{{ form.acceptGeneralTermsAndConditions.vars.id }}">{{ general_terms_and_conditions|raw }}</label> | |
</div> |
Something I wrote years ago but might still be useful. A simple script to replace numeric input
elements with their equivalent select
element to ease input on touch based devices.
javascript:(function%20()%20{%20function%20usePlaceholdersAsFormInput()%20{%20var%20fields%20=%20document.querySelectorAll('input[placeholder]');%20var%20cruft%20=%20/^E\.g\.\s+/;%20for%20(var%20i%20=%200,%20field;%20i%20<%20fields.length;%20i++)%20{%20field%20=%20fields.item(i);%20field.value%20=%20field.placeholder.replace(cruft,%20'');%20}%20}%20function%20selectFirstOptionFromMenus()%20{%20var%20menus%20=%20document.querySelectorAll('select');%20for%20(var%20i%20=%200,%20option;%20i%20<%20menus.length;%20i++)%20{%20option%20=%20menus.item(i).querySelector('option[value]');%20if%20(option)%20{%20option.selected%20=%20true;%20}%20}%20}%20usePlaceholdersAsFormInput();%20selectFirstOptionFromMenus();%20})(); |
Response 😭
HTTP/1.1 201 CREATED
Server: nginx
Date: Fri, 07 Oct 2016 11:34:45 GMT
Content-Type: application/json
Content-Length: 235
Connection: keep-alive
Attempt to build a projection of arriving guests based on the events from the Projections Explained workshop.