Skip to content

Instantly share code, notes, and snippets.

View marlenesco's full-sized avatar

David Foliti marlenesco

View GitHub Profile
@marlenesco
marlenesco / grafana-dashboard-exporter
Created March 10, 2021 01:18 — forked from crisidev/grafana-dashboard-exporter
Command to export all grafana 2 dashboard to JSON using curl
KEY=XXXXXXXXXXXX
HOST="https://metrics.crisidev.org"
mkdir -p dashboards && for dash in $(curl -k -H "Authorization: Bearer $KEY" $HOST/api/search\?query\=\& |tr ']' '\n' |cut -d "," -f 5 |grep slug |cut -d\" -f 4); do
curl -k -H "Authorization: Bearer $KEY" $HOST/api/dashboards/db/$dash > dashboards/$dash.json
done
@marlenesco
marlenesco / .gulp-completion.sh
Created June 12, 2020 14:31 — forked from leventebalogh/.gulp-completion.sh
Fast Gulp auto completion
# Adds basic, but really fast autocompletion for gulp.
#
# NOTE!
# Only the tasknames will be autocompleted.
#
# Why?
# ----
# Default gulp completion is really-really slow, hard to work with.
# However this solution is quite dump, it covers 90% of my workflow.
#
@marlenesco
marlenesco / back_forward.js
Created April 10, 2020 14:25 — forked from sstephenson/back_forward.js
How to detect whether a hash change came from the Back or Forward button
var detectBackOrForward = function(onBack, onForward) {
hashHistory = [window.location.hash];
historyLength = window.history.length;
return function() {
var hash = window.location.hash, length = window.history.length;
if (hashHistory.length && historyLength == length) {
if (hashHistory[hashHistory.length - 2] == hash) {
hashHistory = hashHistory.slice(0, -1);
onBack();
@marlenesco
marlenesco / put-object-on-aws-s3.php
Created May 30, 2018 15:18 — forked from keithweaver/put-object-on-aws-s3.php
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@marlenesco
marlenesco / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Created December 22, 2017 17:08 — forked from andrewstobbe/MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions