// jQuery
$(document).ready(function() {
// code
})
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| This file is based on the javascript.lang file of GtkSourceView. | |
| It has additional Typescript keywords defined. | |
| Author: Johannes Bergmann | |
| Copyright (C) 2014 Johannes Bergmann | |
| ### | |
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
| const multer = require('multer'); | |
| const storage = multer.diskStorage({ | |
| destination: function (req, file, cb) { | |
| cb(null, './uploads/') | |
| }, | |
| filename: function (req, file, cb) { | |
| cb(null, new Date().toISOString() + '-' + file.originalname) | |
| } | |
| }) |
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
| // ES6 w/ Promises | |
| // Note: From a React starter template - see https://t.co/wkStq8y3I5 | |
| function fetchData(routes, params) { | |
| let data = {}; | |
| return Promise.all(routes | |
| .filter(route => route.handler.fetchData) | |
| .map(route => { | |
| return route.handler.fetchData(params).then(resp => { | |
| data[route.name] = resp; |
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 | |
| require 'db_config.php'; | |
| /** | |
| * <?php | |
| * $servername = "127.0.0.1"; | |
| * $username = "root"; | |
| * $password = ""; | |
| * $dbname = "myDB"; | |
| * ?> |
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
| import axios from 'axios' | |
| import Cookies from 'js-cookie' | |
| const setAuthHeader = () => { | |
| const token = Cookies.getJSON('jwt'); | |
| if (token) { | |
| return { headers: {'authorization': `Bearer ${token}`}}; | |
| } |