This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: some-image | |
# dind is necessary for docker | |
services: | |
- name: docker:20.10.10-dind | |
alias: docker | |
# THIS IS IMPORTANT! | |
command: ["--tls=false"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dont forget to activate your endpoint in the plugin | |
// $this->loader->add_action('wp_ajax_nopriv_upload_answer', $plugin_public, 'upload_answer'); | |
// $this->loader->add_action('wp_ajax_upload_answer', $plugin_public, 'upload_answer'); | |
//--------- js code --------------------- | |
const url = "/admin-ajax.php"; | |
//el -> an file input element | |
const data = new FormData(); | |
//append files | |
for (const file of el.files) { | |
console.log('adding', file.name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller\Admin; | |
use App\Controller\AppController; | |
use \PhpExcel; | |
use \PhpExcel\IOFactory; | |
/** | |
* Members Controller | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./lib/mongoose/mongoose').Mongoose; | |
var db = mongoose.connect('mongodb://localhost/testdb'); | |
var User = db.model('User'); | |
var t = {'title': 'test'} | |
var u = new User(t, true); | |
u.isNew = true; //important! | |
u.save(function(){ | |
console.log('saved'); | |
console.log(u); | |
db.close(); |