Skip to content

Instantly share code, notes, and snippets.

@henrikbjorn
henrikbjorn / RelDate.php
Created December 5, 2011 08:01 — forked from arnaud-lb/RelDate.php
4 lines relative date formatter with DateInterval and Symfony2 Translator
<?php
use Symfony\Component\Translation\TranslatorInterface;
function format(\DateTime $date, TranslatorInterface $translator)
{
$diff = date_create()->diff($date);
$seconds = $diff->days * 86400 + $diff->h * 3600 + $diff->i * 60 + $diff->s;
$format = $translator->transChoice('reldate', $seconds);
<script src="https://app.relatel.dk/api/public/endpoints/4571999999/embed.js?key=951fbbf8"></script>
<div class="show-timer">
<p>Ring til os på <strong>71 99 99 99</strong></p>
<p>Vi har åbent kl. <strong>9-16</strong></p>
<span>Firmafon-call-status-short-4571999999</span>
</div>
<div class="show-timer-friday">
<p>Ring til os på <strong>71 99 99 99</strong></p>
version: 2.1
jobs:
build:
docker:
- image: circleci/golang:1.13
steps:
- checkout
- restore_cache:
keys:
const path = require('path');
const fs = require('fs')
const webpack = require('webpack')
const CloudFormation = require('yaml-cfn')
// Extract the AWS::Serverless::Function Resources as they
// are the entires we need to compile.
const { Resources } = CloudFormation.yamlParse(fs.readFileSync('template.yml'))
const entries = Object.values(Resources)
@henrikbjorn
henrikbjorn / package structure
Created July 4, 2019 07:47
Serverless not excluding devDependencies
.serverless/test
└── node_modules
├── @mrmlnc
├── @nodelib
├── @serverless
├── @types
├── accepts
├── agent-base
├── ansi
├── ansi-align
{
"presets": [
["@babel/preset-env", {
"modules": false,
"useBuiltIns": "entry",
"exclude": [
"transform-regenerator"
],
"targets": {
"ie": "11"
var MAX_AGENTS_TO_TEST = 200;
function determineAgents(callDuration, calls, periodLength, answerTarget, serviceLevelTarget) {
if(calls === 0) return(0);
for (var agents = 1; agents <= MAX_AGENTS_TO_TEST; agents++) {
if(serviceLevel(callDuration, calls, periodLength, agents, answerTarget) >= serviceLevelTarget) break;
}
return(agents);
}
// @flow
require('dotenv').config()
const electron = require('electron')
const path = require('path')
const { app, BrowserWindow, ipcMain } = electron
let mainWindow
:party_parrot:
:aw_yeah:
:facepalm:
:bananadance:
:carlton: