Skip to content

Instantly share code, notes, and snippets.

View test.csv
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 2.
name,ring,quadrant,isNew,description
Composer,adopt,dinges,TRUE,"Although the idea of dependency management ..."
Canary builds,trial,techniques,FALSE,"Many projects have external code dependencies ..."
Apache Kylin,assess,platforms,TRUE,"Apache Kylin is an open source analytics solution ..."
JSF,hold,languages & frameworks,FALSE,"We continue to see teams run into trouble using JSF ..."
@stefanvangastel
stefanvangastel / download.sh
Last active May 7, 2020
Download Conda repo's for offline use (including .conda files). First edit links.txt, then run and finish download.sh and end with downloadConda.sh
View download.sh
#!/bin/bash
for link in `cat links.txt`; do
wget -r -l1 -H -t1 -N -np -nH -P "pkgs/" --cut-dirs=1 -e robots=off -R "index.html*" $link
done
# -r recursive
# -l1 maximum recursion depth (1=use only this directory)
# -H span hosts (visit other hosts in the recursion)
# -t1 Number of retries
# -N turn on timestamping
@stefanvangastel
stefanvangastel / downloadLatestDrawioWar.sh
Created Feb 5, 2018
Download latest release of Draw.io as war file
View downloadLatestDrawioWar.sh
#!/bin/bash
json=`curl -s -X GET https://api.github.com/repos/jgraph/drawio/tags`
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w 'name'`
version="$(echo $temp | cut -d\ -f3)"
curl -o "drawio-$version.war" -L https://github.com/jgraph/drawio/releases/download/$version/draw.war
@stefanvangastel
stefanvangastel / bootstrap.php
Last active Mar 19, 2017
CakePHP 3 + Syslog + Logstash + Elasticsearch, these gists are source for a blogpost regarding the out of the box syslog engine for CakePHP 3 and using logstash to push them to elasticsearch
View bootstrap.php
# Change default log engine at the end of bootstrap.php
# See https://book.cakephp.org/3.0/en/core-libraries/logging.html#logging-to-syslog
Log::config('default', [
'engine' => 'Syslog',
'flag' => LOG_ODELAY | LOG_PERROR,
'facility' => LOG_LOCAL7, // Use local7 as dedicated syslog facilty for this app (https://en.wikipedia.org/wiki/Syslog#Facility)
'prefix' => 'MY_APP'
]);
@stefanvangastel
stefanvangastel / docker-load-and-push.sh
Last active Aug 26, 2022
Bash scripts to pull, (optional) retag, save, load and push Docker images. Created to provide easy means to download an image, retag it to use a private registry and then save it to an external disk. In a offline or on-premise environment you can use the load and push script to load images and push them to a private registry.
View docker-load-and-push.sh
#!/bin/bash
#### Functions ###
display_usage() {
echo "This script must be run with Docker capable privileges and you should login to your registry before pushing!"
echo -e "\nUsage:\n$0 <saved_image> [--push]\n"
echo -e " <saved_image>\t\t\tThe image file to load and push"
echo -e " [--push]\t\t\tPush to registry"
echo -e "\nExample: $0 /mydir/ubuntu.tar --push "
}
View docker-compose.yml
vamp-workflow-health:
environment:
VAMP_KEY_VALUE_STORE_TYPE: consul
VAMP_KEY_VALUE_STORE_CONNECTION: consul:8500
VAMP_URL: http://vamp:8080
VAMP_KEY_VALUE_STORE_ROOT_PATH: /vamp/workflow/health
labels:
breed: health
workflow: health
image: magneticio/vamp-workflow-agent:0.9.0
@stefanvangastel
stefanvangastel / default.ctp
Last active Oct 10, 2017 — forked from ichord/gist:9808444
demo of using pdf.js to extract pages to images in CakePHP (http://book.cakephp.org/3.0/en/views.html#using-view-blocks)
View default.ctp
//Your layout file
<html>
<head>
//etc
</head>
<body>
//Bla bla
<?php
@stefanvangastel
stefanvangastel / firebaseAngularJsExample.html
Created Sep 16, 2015
One file Firebase AngularJS Angularfire example
View firebaseAngularJsExample.html
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>Firebase AngularJS Demo</title>
<!-- AngularJS -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
@stefanvangastel
stefanvangastel / porche.jpg
Created Jun 1, 2015
Base64 encoded OpenALPR example image
View porche.jpg
/9j/4RX8RXhpZgAATU0AKgAAAAgADAEAAAMAAAABBAAAAAEBAAMAAAABAkAAAAECAAMAAAADAAAAngEGAAMAAAABAAIAAAESAAMAAAABAAEAAAEVAAMAAAABAAMAAAEaAAUAAAABAAAApAEbAAUAAAABAAAArAEoAAMAAAABAAIAAAExAAIAAAAcAAAAtAEyAAIAAAAUAAAA0IdpAAQAAAABAAAA5AAAARwACAAIAAgACvyAAAAnEAAK/IAAACcQQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzADIwMTI6MDU6MTYgMjI6NTM6NDkAAASQAAAHAAAABDAyMjGgAQADAAAAAf//AACgAgAEAAAAAQAAAnygAwAEAAAAAQAAAWYAAAAAAAAABgEDAAMAAAABAAYAAAEaAAUAAAABAAABagEbAAUAAAABAAABcgEoAAMAAAABAAIAAAIBAAQAAAABAAABegICAAQAAAABAAAUegAAAAAAAABIAAAAAQAAAEgAAAAB/9j/7QAMQWRvYmVfQ00AAv/uAA5BZG9iZQBkgAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgRDAwMDAwMEQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBDQsLDQ4NEA4OEBQODg4UFA4ODg4UEQwMDAwMEREMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEIAFoAoAMBIgACEQEDEQH/3QAEAAr/xAE/AAABBQEBAQEBAQAAAAAAAAADAAECBAUGBwgJCgsBAAEFAQEBAQEBAAAAAAAAAAEAAgMEBQYHCAkKCxAAAQQBAwIEAgUHBggFAwwzAQACEQMEIRIxBUFRYRMicYEyBhSRobFCIyQVUsFiMzRygtFDByWSU/Dh8WNzNRaisoMmRJNUZEXCo3Q2F9JV4mXys4TD03Xj80YnlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vY3R1dnd4eX
@stefanvangastel
stefanvangastel / appDirectives.js
Created Mar 17, 2015
CakePHP 3 form validation message by AngularJS directive
View appDirectives.js
var appDirectives = angular.module('appDirectives', []);
/**
* Add potential validation fields to form-control form elements (CakePHP 3 with Bootstrap)
*
* Requirement: $scope.errors contains option (validation) errors in default CakePHP 3 JSON response
*/
appDirectives.directive('formControl', function($compile) {
return {
restrict: 'C', //Match all elements with form-control class