Skip to content

Instantly share code, notes, and snippets.

View aforemny's full-sized avatar
turning coffee into bugs

Alexander Foremny aforemny

turning coffee into bugs
View GitHub Profile
module Main where
import Time exposing (fps)
import Graphics.Element exposing (show)
import Signal exposing (foldp, map, sampleOn)
import List exposing (length)
main =
map view model
-- page.html
<DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css">
<link rel="stylesheet" href="https://opensource.keycdn.com/fontawesome/4.6.3/font-awesome.min.css">
<script src="elm.js"></script>
@aforemny
aforemny / Window.elm
Created August 28, 2017 12:57
Elm effects manager for `window.onscroll` subscription, `onScroll : ({ pageX : Float, pageY : Float } -> m) -> Sub m`
effect module Window where { subscription = MySub } exposing
( onScroll
)
import Dom.LowLevel as Dom
import Json.Decode as Json
import Process
import Task exposing (Task)
@aforemny
aforemny / docs.json
Created May 9, 2018 12:10
elm-mdc docs.json as of today
[
{
"name": "Material.Toolbar",
"comment": "\nA toolbar is a container for multiple rows that contain items such as the\napplication's title, navigation menu and tabs, among other things.\n\nBy default a toolbar scrolls with the view. You can change this using the\n`fixed` or `waterfall` properties. A `flexible` toolbar changes its height when\nthe view is scrolled.\n\n\n# Resources\n\n- [Material Design guidelines: Toolbars](https://material.io/guidelines/components/toolbars.html)\n- [Demo](https://aforemny.github.io/elm-mdc/#toolbar)\n\n\n# Example\n\n```elm\nimport Html exposing (text)\nimport Material.Toolbar as Toolbar\n\n\nToolbar.view Mdc [0] model.mdc []\n [ Toolbar.row []\n [ Toolbar.section\n [ Toolbar.alignStart\n ]\n [ Toolbar.menuIcon [] \"menu\"\n , Toolbar.title [] [ text \"Title\" ]\n ]\n , Toolbar.section\n [ Toolbar.alignEnd\n ]\n [ Toolbar.ic
@aforemny
aforemny / AjaxController.php
Created July 13, 2018 13:06
Pass storagePid to Ajax controller in TYPO3
<?php
declare(strict_types=1);
namespace Company\Extension\Controller\Ajax;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;

Keybase proof

I hereby claim:

  • I am aforemny on github.
  • I am aforemny (https://keybase.io/aforemny) on keybase.
  • I have a public key ASAG0B8_JHjPA4RpP7h_ygVV1X0awJRTxADb7IHMr80TPwo

To claim this, I am signing this object:

trace: Using plugins: ["/nix/store/3jvdd81nv8a8hirhs7avnxnq6vbbcbm3-nixops-aws-1.7pre0_abcdef"]
these derivations will be built:
/nix/store/a3hmiiv1q7g7kkvqqn5r6lq7id933z0j-nixops-1.8pre0_abcdef.drv
building '/nix/store/a3hmiiv1q7g7kkvqqn5r6lq7id933z0j-nixops-1.8pre0_abcdef.drv'...
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Sourcing pip-install-hook
Using pipInstallPhase
aforemny 1 day ago
Hi!, I am wondering about a HTML thing: if I create a <form> that contains an <input type="text"> and I read that input's pattern property, I get back the empty string. The input does not have validation associated to it: if I type the letter "a", the input does not become invalid. However, if I set that input's pattern property to the empty string, then the input has validation associated to it. If I then type the letter "a", that input becomes invalid (because "a" does not match the empty string pattern).
Here is an example of what I am observing: https://jsfiddle.net/Lcur56ne/ . To reproduce, type "a" in the input (it does not become invalid), then press the button (the input becomes invalid). The console shows that input's pattern attribute type and value prior to setting it to the empty string.
How can I make sense of that? In particular, how can I differentiate whether that input's pattern property is set to the empty string or undefined as in has not been set yet?
jsfiddle.net
Ed
% curl https://hydra.nixos.org/build/135077409/reproduce | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4080 100 4080 0 0 22793 0 --:--:-- --:--:-- --:--:-- 22921
storing inputs and results in /tmp/build-135077409...
running nix-build...
using these flags: --arg nixpkgs { outPath = /tmp/build-135077409/nixpkgs/source; rev = "956afcd713a4f94a4acb4460d339dc638bac3d0a"; shortRev = "956afcd"; revCount = 263447; } -I nixpkgs=/tmp/build-135077409/nixpkgs/source --arg stableBranch false --option extra-binary-caches https://hydra.nixos.org/ --option system x86_64-linux /tmp/build-135077409/nixpkgs/source/nixos/release-combined.nix -A
warning: ignoring untrusted substituter 'https://hydra.nixos.org/'
/nix/store/3mjbw9fw21m5pidhh4nrsi904xvqy7n6-nixos-21.03pre263447.956afcd
nix-build --arg nixpkgs { outPath = /tmp/build-135077409/nixpkgs/source; rev = "956afcd713a4f94a4acb4460d339dc638bac3d0a"; shortRev = "956afcd"; revCount = 263447; } -I nixpkgs=/tmp/build-135077409/nixpkgs/source --arg stableBranch false --option extra-binary-caches https://hydra.nixos.org/ --option system x86_64-linux /tmp/build-135077409/nixpkgs/source/nixos/release.nix -A tests.networking.scripted.virtual