Skip to content

Instantly share code, notes, and snippets.

View simonj's full-sized avatar
👋

Simon simonj

👋
View GitHub Profile
@simonj
simonj / badWords.php
Last active November 21, 2016 12:47
Filter all bad words from array
<?php
class BadWordFilter
{
/**
* @var array
**/
public $badWords = ['fuck', 'idiot'];
downloadPlan() {
let formData = document.getElementById("planComponent").innerHTML
axios.post('/api/training-plans/download', {responseType: 'arraybuffer', data: formData})
.then(response => {
this.downloadFile(response, 'customFilename')
this.$toasted.show('Nu har nu downloadet planen', {type: 'success'})
}, response => {
this.$toasted.show('Planen kunne ikke downloades, prøv igen', {type: 'error'})
console.warn('error from download_contract')
downloadPlan() {
let formData = document.getElementById("planComponent").innerHTML
axios.post('/api/training-plans/download', {responseType: 'arraybuffer', data: formData})
.then(response => {
this.downloadFile(response, 'customFilename')
this.$toasted.show('Nu har nu downloadet planen', {type: 'success'})
}, response => {
this.$toasted.show('Planen kunne ikke downloades, prøv igen', {type: 'error'})
console.warn('error from download_contract')