Skip to content

Instantly share code, notes, and snippets.

@marijn
marijn / Placefill.js
Created Oct 27, 2017
Bookmarklet for filling out forms with placeholder data
View Placefill.js
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 Oct 7, 2016
Sendgrid API response
View README.markdown

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 Jun 28, 2016
Attempt to build a projection of arriving guests based on the events from the Projections Explained workshop.
View README.markdown
View cache-assets.sql
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
View gist:c363b85a146ede74519e
export PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH"
@marijn
marijn / NOTES.markdown
Last active Jan 2, 2016
Notes I took while reading Priming Kanban by Jesper Boeg.
View NOTES.markdown

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
View php54-qrcode.rb
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 Dec 15, 2015
Alternative to the default SecurityContextInterface implementation from Symfony
View SecurityGuard.php
<?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 Mar 5, 2013
Symfony2 array based forms are not taking constraints into account...
View SomeController.php
<?php
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Validator\Constraints\Length;
final class SomeController extends Controller
{
/**
* @return \Symfony\Component\Form\Form
*/
View services.xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="pink_tie.logger.command_formatter" class="Monolog\Formatter\LineFormatter">
<argument>{ "%%message%%": %%context%% }
</argument>
</service>
</services>
</container>
You can’t perform that action at this time.