peekobot — a simple, choice-driven chatbot framework for your website written in less than 100 lines of vanilla JavaScript (and some CSS)

peekobot - a simple, choice-driven chatbot framework for your website written in less than 100 lines of vanilla JavaScript (and some CSS)

const chat = {
    1: {
        text: 'Good morning sir',
        next: 2
    },
    2: {
        text: 'Would you like tea or coffee with your breakfast?',
        options: [
            {
                text: 'Tea',
                next: 3
            },
            {
                text: 'Coffee',
                next: 4
            }
        ]
    },
    3: {
        text: 'Splendid - a fine drink if I do say so myself.'
    },
    4: {
        text: 'As you wish, sir'
    }
}

https://github.com/Peekobot/peekobot | example page

Freezeframe.js — библиотека приостанавливает анимированные файлы .gifs и возвращает им анимирацию при наведении мыши / щелчке мыши / касании или запуске вручную

Работает это так: записывается первый кадр в canvas элемент. После старта проигрывается сама GIF

// Default options
new Freezeframe();

// String as selector
new Freezeframe('.foo');

// DOM reference as selector
new Freezeframe(document.querySelectorAll('.foo'));

// Custom options
new Freezeframe({
  selector: '.foo',
  trigger: 'click',
  overlay: true,
  responsive: false
});

// Also valid syntax
new Freezeframe('.foo', {
  trigger: 'click',
  overlay: true,
  responsive: false
});

https://github.com/ctrl-freaks/freezeframe.js/

krakjoe/ilimit — скрипт для ограничения времени и потребление памяти выполнения в PHP

Требования
PHP 7.1+
NTS
pthread.h

namespace ilimit {
    /**
     * Call a callback while imposing limits on the time and memory that
     * the call may consume.
     *
     * @param callable $callable      The invocation to make.
     * @param array    $arguments     The list of arguments.
     * @param int      $timeout       The maximum execution time, in microseconds.
     * @param int      $maxMemory     The maximum amount of memory, in bytes.
     *                                If set to zero, no limit is imposed.
     * @param int      $checkInterval The interval between memory checks,
     *                                in microseconds. If set to zero or less,
     *                                a default interval of 100 microseconds is used.
     *
     * @return mixed Returns the return value of the callback.
     *
     * @throws Error\\Runtime If timeout is not positive.
     * @throws Error\\Runtime If maxMemory is negative.
     * @throws Error\\System  If the system lacks necessary resources to make the call.
     * @throws Error\\Timeout If the invocation exceeds the allowed time.
     * @throws Error\\Memory  If the invocation exceeds the allowed memory.
     */
    function call(callable $callable, array $arguments, int $timeout, int $maxMemory = 0, int $checkInterval = 0);
}

https://github.com/krakjoe/ilimit

thomasjohnkane/snooze — пакет для упрощения автоматизации будущих уведомлений и напоминаний в Laravel

use Thomasjohnkane\\Snooze\\Traits\\SnoozeNotifiable;

class User extends Model {
    use SnoozeNotifiable;

    // ...
}

// Schedule a birthday notification
$user->notifyAt(new BirthdayNotification, Carbon::parse($user->birthday));

// Schedule for a week from now
$user->notifyAt(new NextWeekNotification, Carbon::now()->addDays(7));

// Schedule for new years eve
$user->notifyAt(new NewYearNotification, Carbon::parse('last day of this year'));

https://github.com/thomasjohnkane/snooze

paulirish/lite-youtube-embed — скрипт более быстрого внедрения youtube

Разработчик скрипта утверждает что он в 224 раза быстрее обычной вставки embed.

<lite-youtube videoid="ogfYd705cRs" style="background-image: url('https://i.ytimg.com/vi/ogfYd705cRs/hqdefault.jpg');">
	<div class="lty-playbtn"></div>
</lite-youtube>

https://github.com/paulirish/lite-youtube-embed

xxczaki/cashify — js скрипт конвертации валюты, наследник money.js

const {Cashify} = require('cashify');

const rates = {
	GBP: 0.92,
	EUR: 1.00,
	USD: 1.12
};

const cashify = new Cashify({base: 'EUR', rates});

const result = cashify.convert(10, {from: 'EUR', to: 'GBP'});

console.log(result); //=> 9.2

https://github.com/xxczaki/cashify

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. ...
  9. 226
Scroll Up