Skip to content

Instantly share code, notes, and snippets.

View marijn's full-sized avatar

Marijn Huizendveld marijn

View GitHub Profile
@marijn
marijn / README.markdown
Created November 26, 2021 17:42
Replace numeric input element with select element on mobile devices

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.

@marijn
marijn / Placefill.js
Created October 27, 2017 14:21
Bookmarklet for filling out forms with placeholder data
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})();
@marijn
marijn / README.markdown
Created October 7, 2016 11:39
Sendgrid API response

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
@marijn
marijn / README.markdown
Last active June 28, 2016 21:38
Attempt to build a projection of arriving guests based on the events from the Projections Explained workshop.
SELECT CONCAT(
'bin/ams-gateway ams:cache-asset ',
ams_gateway_asset.asset,
' ',
ams_gateway_asset.nameOfRecipe
) AS command
FROM ams_gateway_asset
ORDER BY asset
LIMIT 0, 100
export PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH"
@marijn
marijn / NOTES.markdown
Last active January 2, 2016 07:48
Notes I took while reading Priming Kanban by Jesper Boeg.

These are some thoughts on Kanban after reading [Priming Kanban][1].

Most important thing to remember:

#Kanban is a change method!#

Methodology Kind of process Change adoption
Plan Methodology Too much proces Resist change
Agile Just enough process Change is the fuel that keeps the engine running
require File.join(File.dirname(__FILE__), 'abstract-php-extension')
class Php54Qrcode < AbstractPhp54Extension
init
homepage 'https://github.com/rsky/qrcode/'
url 'https://github.com/rsky/qrcode/archive/629666244a2e033c9172d2a856cc397a1f838da6.zip'
sha1 '8a8301eac1be7d573ef57efdc83b3e48e93b99f3'
version '0.1.0'
depends_on 'php54'
@marijn
marijn / SecurityGuard.php
Last active December 15, 2015 04:59
Alternative to the default SecurityContextInterface implementation from Symfony
<?php
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
final class SecurityGuard implements SecurityContextInterface
{
private $nativeSecurityContext;
public function __construct(SecurityContextInterface $nativeSecurityContext)
@marijn
marijn / SomeController.php
Created March 5, 2013 00:05
Symfony2 array based forms are not taking constraints into account...
<?php
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Validator\Constraints\Length;
final class SomeController extends Controller
{
/**
* @return \Symfony\Component\Form\Form
*/