Skip to content

Instantly share code, notes, and snippets.

View travisbotello's full-sized avatar

Travis Botello travisbotello

  • San Juan, Puerto Rico
View GitHub Profile
@javilobo8
javilobo8 / download-file.js
Last active October 27, 2024 09:15
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@mkay
mkay / nginx.conf
Last active October 6, 2015 08:31
MODX Babel rewrites for nginx
server {
location / {
# MODX babel rewrites
rewrite ^/(en|de)/css(.*)$ /css$2 break;
rewrite ^/(en|de)/js(.*)$ /js$2 break;
rewrite ^/(en|de)/img(.*)$ /img$2 break;
@gibbs
gibbs / clear_modx_cache_2.1.php
Last active November 13, 2018 17:18
Refresh / clear the MODX Revolution 2.1+ cache
<?php
// Dan Gibbs
// Clear MODx Revolution Cache (2.1 and later)
// Path to MODx Core Directory
define("MODX_CORE_PATH", "../core/");
define("MODX_CONFIG_KEY", "config");
// Include MODx main class
include(MODX_CORE_PATH . "model/modx/modx.class.php");