Skip to content

Instantly share code, notes, and snippets.

<template>
<div class="a" v-html="content"></div>
</template>
<script>
export default {
data() {
return {
content: 'this is a <a class="b">Test</a>',
}
@BrockReece
BrockReece / App.vue
Created September 18, 2017 13:45
Vue debugger example
<template>
<div>{{ hello }}</div>
</template>
<script>
export default {
data() {
return {
hello: 'Hello',
}
@BrockReece
BrockReece / launch.json
Last active September 18, 2017 13:36
Chrome debugging in Visual Studio Code
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Remote debugging",
"sourceMaps": true,
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}"
@BrockReece
BrockReece / analytics.js
Created April 15, 2017 17:33
Vue form analytics mixin
import { mapActions } from 'vuex'
export default {
methods: {
...mapActions([
'updateInputFocus',
]),
lastInputFocus(e) {
if (!e.srcElement.name) return
{
"appKey": "randomKey",
"authHost": "https://corestaging.croudcontrol.com",
"authEndpoint": "/broadcasting/auth",
"database": "redis",
"databaseConfig": {
"redis": {
"port": "6379",
"host": "localhost",
"options": {
@BrockReece
BrockReece / Capitalize.js
Created October 26, 2016 11:33
Split slug into separate words and capitalise
field.field_slug.split('_').join(' ').replace(/\b\w/g, l => l.toUpperCase())
@BrockReece
BrockReece / close-server-logs.yml
Created July 25, 2016 07:50
Curator script for closing old indices
actions:
1:
action: close
description: >-
Close indices older than 2 days (based on index name), for logstash
and beat indices.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
@BrockReece
BrockReece / cloudwatch-pipeline.conf
Last active September 10, 2020 18:16
Logstash cloudwatch output sample pipeline
input {
http_poller {
urls => {
node => {
method => get
url => "http://localhost:9200/_cluster/health"
headers => {
Accept => "application/json"
}
}
this.$http.post(this.resource, data, {
beforeSend(xhr) {
if (this.lastRequest) {
this.lastRequest.cancel()
}
this.lastRequest = xhr
},
}).then(response => {
//do something with request
})
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.