Skip to content

Instantly share code, notes, and snippets.

View simonj's full-sized avatar
👋

Simon simonj

👋
View GitHub Profile
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')
@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'];
module.exports = {
data() {
return {
personData: []
}
},
ready() {
console.log('ready');
@simonj
simonj / addDomain.js
Last active September 15, 2015 17:36
/*
* This component adds domains to the DB
*/
module.exports = {
methods: {
/**
* Add domain to the DB
*/
createDomain: function() {
/*
* test
*/
Vue.component('domainKeeper-test', {
template: '<p>A custom component!</p>'
});
@simonj
simonj / adddomain
Created September 12, 2015 14:34
app.js
var addDomain = Vue.extend({
});
@simonj
simonj / test
Created July 20, 2015 11:04
test
function updateCenterStats(cid)
{
console.log('clicked');
//var checkbox = $("input[type='checkbox']").val();
var checkbox = $("input[type='checkbox']").prop('checked');
console.log('checkbox: '+ checkbox);
var center = null;
$.ajax({

##This is a list of good alias for Laravel


use: nano ~/.bash_profile

When you have SSH'et into Vagrant

@simonj
simonj / SassMeister-input.scss
Created April 24, 2015 09:36
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
/**
* This file is a helper to easy make media queries.
*
* How to use:
* @include respond-to(small) { ... }