Skip to content

Instantly share code, notes, and snippets.

attached() {
this.fu = new qq.FineUploaderBasic({
// button: document.getElementById('uploadButton'),
request: {
endpoint: '/api/upload',
inputName: 'qqfile'
},
validation: {
// acceptFiles: ['image/jpeg', 'image/jpg', 'image/png', 'application/pdf'],
// allowedExtensions: ['jpeg', 'jpg', 'pdf', 'png'],
/**
* Observe the DOM for changes to find new Cavy topics.
*/
var observeDOM = (function() {
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
eventListenerSupported = window.addEventListener;
return function(obj, callback) {
if (MutationObserver) {
<?php
class FastSpringAPIClient {
const USER_AGENT = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
function __construct() {
}
@rquast
rquast / config.json
Created June 20, 2017 13:20 — forked from andris9/config.json
ZoneMTA DKIM plugin example
{
"plugins": {
"dkim": {
"enabled": "sender",
"domain": "example.com",
"selector": "test",
"path": "/path/to/private/key.pem"
}
}
}
@rquast
rquast / index.md
Created June 21, 2017 00:30 — forked from andris9/index.md
Retrieve UDP logs from ZoneMTA

Step 1. Install MessagePack module

ZoneMTA emits logs over UDP in MessagePack format, so a MessagePack parser is needed to read log messages

npm install msgpack-js

Step 2. Update MTA config

Edit your ZoneMTA application config to activate remote UDP logging. Add remote to the log section. Port and host should point to the server where logger.js app is running.

@rquast
rquast / attached.js
Created July 9, 2017 01:05 — forked from peisenmann/attached.js
Aurelia custom attribute to invoke a callback when an element gets added to the dom. Demo: http://plnkr.co/edit/fguuz4
import {customAttribute, bindable, LogManager} from 'aurelia-framework';
const logger:Logger = LogManager.getLogger("attached");
/**
* MIT License. Patrick Eisenmann.
* Apply this attribute to an element to have a callback invoked when the element added to the DOM
*
* @param {Function} callback. Required. The function to be invoked.
* The first argument to the callback is the Element that had the attached on it.
/**
* Module dependencies
*/
var qs = require('qs')
var log = require('node-gelf')('graylog.cavy.io')
log.fields.facility = 'cavy-connect'
/**
* Error Response
<?php
$query = [
'index' => $this->subdomain,
'type' => ['topics', 'documents'],
'body' => [
'query' => [
'multi_match' => [
'query' => $queryParams['content'],
'fields' => ['name^5', 'description^4', 'h*^3', 'content^2', 'pinned', 'related'],
@rquast
rquast / docker-compose.yml
Created October 9, 2017 02:51 — forked from huksley/docker-compose.yml
Launches fully configured Graylog 2.3.1 instance
#
# Launches configured Graylog 2.3.1 instance
#
# - Docker-compose 1.16 required
# - Please configure following according to your network:
# * gelf-address URL (for each container)
# * GRAYLOG_WEB_ENDPOINT_URI
# - After launch define GELF tcp and GELF udp inputs in graylog web ui
# - Containers send logging to the graylog itself
# - By default tuned to 30 days retention
[ 0.000000] microcode: microcode updated early to revision 0x25, date = 2017-01-27
[ 0.000000] Linux version 4.10.0-37-hello-generic (root@rquast-MacBook) (gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2) ) #41 SMP Wed Oct 18 15:36:29 AEST 2017 (Ubuntu 4.10.0-37.41-generic 4.10.17)
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.10.0-37-hello-generic root=/dev/mapper/ubuntu--vg-root ro nosplash irqpoll intremap=nosid
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'