Skip to content

Instantly share code, notes, and snippets.

@ixcviw7bw
ixcviw7bw / index.ts
Created August 18, 2021 20:21
Shoper JSON API proxy
import AbortController from "abort-controller";
import { FastifyInstance } from "fastify";
import { performance } from "perf_hooks";
import {
ShoperJsonCall,
ShoperJsonModuleMethod,
ShoperJsonRequest,
} from "./types";
const PROXY_TIMEOUT = 240000;
@ixcviw7bw
ixcviw7bw / index.html
Last active January 18, 2021 21:50
TypeScript in browser
<!DOCTYPE html>
<meta charset="utf-8">
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<div id="output"></div>
<script
type="text/babel"
data-type="module"
data-plugins="proposal-class-properties"
@ixcviw7bw
ixcviw7bw / webpack3_babel7.md
Last active January 29, 2018 08:22
webpack 3 + babel 7 config example

.babelrc

{
  "presets": [
    ["@babel/preset-env", {
      "exclude": ["transform-regenerator"],
      "modules": false
    }], "@babel/preset-react"
  ],
<?php
$year = '1989';
$month = '01';
$day = '01';
$birthDate = \DateTime::createFromFormat('Y-m-d', $year . '-' . $month . '-' . $day);
$ageInterval = $birthDate->diff(new \DateTime());
$age = (int)$ageInterval->format('%y');
echo $age;