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
@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
// 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"
'use strict';
/* Filters */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
};
}]).
$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"},
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);
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
namespace TOCParser
{
public class XHtmlDocParser
{
private XmlNamespaceManager _mgr;
@GeertVL-zz
GeertVL-zz / simple.rb
Created September 26, 2013 13:40
Exercise for 'Understanding Computation'
## Arrived at page 52 (Statements)
class Number < Struct.new(:value)
def to_s
value.to_s
end
def inspect
"<<#{self}>>"
end
mymodule.directive('nullIfEmpty', [function() {
return {
require: 'ngModel',
link: function(scope, elm, attr, ctrl) {
ctrl.$parsers.unshift(function(value) {
return value === '' ? null : value;
});
}
};
}]
@GeertVL-zz
GeertVL-zz / fileupload.html
Created August 22, 2013 05:43
fileupload that works in html4 and html5
<!DOCTYPE html>
<html >
<head>
<title>Files property test</title>
<script type="text/javascript">
function reqListener() {
console.log('listened');
}
function getFiles() {
@GeertVL-zz
GeertVL-zz / Point.cs
Created July 28, 2013 14:59
Game math
using System;
namespace MacRocketFly
{
public class Point
{
public float X {
get;
set;
}