Mix.install([
{:dsmr, github: "mijnverbruik/dsmr"},
{:kino, "~> 0.12.0"},
{:kino_vega_lite, "~> 0.1.10"}
])
alias VegaLite, as: Vl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getUpAttributes } from "./utils" | |
function transition(element, stages) { | |
stages.start() | |
stages.during() | |
requestAnimationFrame(() => { | |
// Note: Safari's transitionDuration property will list out comma separated transition durations | |
// for every single transition property. Let's grab the first one and call it a day. | |
let duration = Number(getComputedStyle(element).transitionDuration.replace(/,.*/, '').replace('s', '')) * 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useContext, useMemo, useState } from 'react' | |
class OAuthError extends Error { | |
constructor(error, description, uri) { | |
super(error) | |
this._description = description | |
this._uri = uri | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\EventListener; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename = __DIR__.'/../dist/'.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']); | |
if (php_sapi_name() === 'cli-server' && is_file($filename)) { | |
return false; | |
} | |
require_once __DIR__.'/../vendor/autoload.php'; | |
use Aws\Lambda\LambdaClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { renderToString } from 'react-dom/server'; | |
import Application from '../client/app'; | |
export function handler(event, context) { | |
const markup = renderToString(<Application name={event.name} />); | |
context.succeed(markup); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>php-react-lamda-example</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script> | |
window.__INITIAL_PAYLOAD__ = { name: "World" }; | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const Application = (props) => ( | |
<div>Hello, {props.name}!</div> | |
); | |
export default Application; |
I hereby claim:
- I am robinvdvleuten on github.
- I am robinvdvleuten (https://keybase.io/robinvdvleuten) on keybase.
- I have a public key ASArf4GdyA_UfDxuq4-m9lZLwoj8JBNhut8x_eFzL-vKwwo
To claim this, I am signing this object:
NewerOlder