Skip to content

Instantly share code, notes, and snippets.

View gerzenstl's full-sized avatar

Luis Gerzenstein gerzenstl

View GitHub Profile
@ibreathebsb
ibreathebsb / upload.js
Last active January 6, 2026 07:48
file upload from dataUrl with axios
// Note: only for modern browser
import axios from 'axios'
// helper function: generate a new file from base64 String
const dataURLtoFile = (dataurl, filename) => {
const arr = dataurl.split(',')
const mime = arr[0].match(/:(.*?);/)[1]
const bstr = atob(arr[1])
let n = bstr.length
const u8arr = new Uint8Array(n)
@e0ipso
e0ipso / api-first-priorities.md
Last active October 13, 2017 15:14
API-First Priorities
@jtrobman
jtrobman / gist:7661586
Last active December 29, 2015 11:09
Apache config to render all Drupal files from www except CSS and JS.
ProxyPassMatch .+/files/(css|js)/.+ !
ProxyPassMatch ^/sites/(.+)/files/(.+)$ http://www.$1/sites/$1/files/$2
@pascalduez
pascalduez / html.tpl.php
Created December 1, 2011 16:47
Drupal 7 — Move $scripts at page bottom
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>