Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Simon SimonJ

👋
View GitHub Profile
View Vuejs.js
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')
View Vuejs
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 Nov 21, 2016
Filter all bad words from array
View badWords.php
<?php
class BadWordFilter
{
/**
* @var array
**/
public $badWords = ['fuck', 'idiot'];
View person.js
module.exports = {
data() {
return {
personData: []
}
},
ready() {
console.log('ready');
View addDomain.js
/*
* This component adds domains to the DB
*/
module.exports = {
methods: {
/**
* Add domain to the DB
*/
createDomain: function() {
View addDomain.js
/*
* test
*/
Vue.component('domainKeeper-test', {
template: '<p>A custom component!</p>'
});
View adddomain
var addDomain = Vue.extend({
});
View 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({
View gist:fc033d9aee247956f067

##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 Apr 24, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// 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) { ... }