Skip to content

Instantly share code, notes, and snippets.

View richardwillars's full-sized avatar

Richard Willars richardwillars

View GitHub Profile
@richardwillars
richardwillars / ThumbnailGenerator.js
Last active December 18, 2017 14:45
Thumbnail generator plugin
const Plugin = require('../Plugin')
const Utils = require('../../core/Utils')
/**
* The Thumbnail Generator plugin
*
*/
module.exports = class ThumbnailGenerator extends Plugin {
constructor(core, opts) {
super(core, opts)
@richardwillars
richardwillars / core.js
Created November 23, 2017 09:40
Sequential thumbnail generation
constructor(opts) {
...
this.queue = []
this.queueProcessing = false
...
}
actions () {
...
this.on('core:file-added', (file) => {
import { Core, Tus10 } from 'uppy';
import runtime from 'serviceworker-webpack-plugin/lib/runtime';
export const uppy = new Core({ wait: false });
function uploaderUpdatedAction(value) {
return {
type: 'UPLOADER_UPDATED',
value
};
import { Plugin } from 'uppy';
export default class ReduxEmitter extends Plugin {
constructor(core, opts) {
super(core, opts);
this.type = 'redux';
this.id = 'ReduxEmitter';
this.title = 'Redux Emitter';
// set default options
const defaultOptions = {};
@richardwillars
richardwillars / mobile_detector.php
Created January 21, 2012 08:52 — forked from tubalmartin/mobile_detector.php
Lightweight detector of mobile devices, OSs & browsers (PHP)
<?php
/*
* Lightweight detector of mobile devices, OSs & browsers
* Copyright 2012 Túbal Martín (email: tubalmartin@gmail.com)
* License: GPL2
*/
if ( ! function_exists('mobile_detector') )
{