Skip to content

Instantly share code, notes, and snippets.

View GeertVL-zz's full-sized avatar
💭
Working full time in Azure technologies

Geert Van Laethem GeertVL-zz

💭
Working full time in Azure technologies
View GitHub Profile
angular.module('myApp.controllers', []).
controller('MyCtrl1', ['$scope', function($scope) {
$scope.uploadFile = function() {
console.log("Uploading file");
for (var i = 0, f; f = $scope.files[i]; i++) {
var reader = new FileReader();
reader.onloadend = function(evt) {
if (evt.target.readyState == FileReader.DONE) {
console.log(evt.target.result);
}
$scope.filesPortfolio = {
id:0,
idName:"Documents",
number:"1",
name:"Documents",
files:[
{id:0,type:"image",title:"Brochure Cooling", image:"thumb0.png"},
{id:1,type:"image",title:"Cooling systems", image:"thumb1.jpg"},
{id:2,type:"image",title:"Transport systems", image:"thumb2.jpg"},
{id:3,type:"video",title:"Long distance transport", image:"thumb3.jpg"},
'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
};
}]).
// The SqlEntityConnection (Entity Data Model) TypeProvider allows you to write code that uses
// a live connection to a database that is represented by the Entity Data Model. For more information,
// please go to
// http://go.microsoft.com/fwlink/?LinkId=229210
module GeertVLConnection
#if INTERACTIVE
#r "System.Data"
#r "System.Data.Entity"
@GeertVL-zz
GeertVL-zz / gist:f5f80f3ada31417e3dbc
Created April 6, 2015 16:30
BDD with only XUnit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Specs.Registration
{
public enum UserStatus
public class Guest : UntypedActor
{
private IActorRef _receptionist;
public Guest()
{
var receptionist = Context.ActorSelection("/user/Klara");
receptionist.Tell(new Identify("111"), Self);
}
public class TipCalculatorViewModel : INotifyPropertyChanged
{
private readonly TipCalculation _model;
private readonly ITipCalculatorRepository _repository;
public event PropertyChangedEventHandler PropertyChanged;
public TipCalculatorViewModel(ITipCalculatorRepository repository)
{
_model = new TipCalculation();
require 'sinatra'
get '/hi' do
"Hello world!"
end
@GeertVL-zz
GeertVL-zz / Vagrantfile
Created November 11, 2016 09:20
Vagrantfile for RabbitMQ server
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 15672, host: 15672
config.vm.network :forwarded_port, guest: 5672, host: 5672
config.vm.network :forwarded_port, guest: 5671, host: 5671
@GeertVL-zz
GeertVL-zz / postgres-docker-local.md
Last active May 25, 2021 08:17
How to install postgres and pgadmin in a docker environment on your local macos machine

I experienced that installing your Postgres database server on your local machine as a Docker container is not that evident. So this explains how you need to do it and what you need to take into account.

To setup your Postgres Docker container you need to run:

docker run -d -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword --name postgres-server -p 5432:5432 -v pgdata:/var/lib/postgresql/data --restart=always postgres

And to run your pgadmin instance as a Docker container: