Skip to content

Instantly share code, notes, and snippets.

View gilles-leblanc's full-sized avatar

Gilles Leblanc gilles-leblanc

View GitHub Profile
I would personally use the term DTO only when the Data is being transferred across layers, services or applications.
Wikipedia defines it as:
is an object that carries data between processes
Also this highly upvoted answer on StackOverflow says:
@gilles-leblanc
gilles-leblanc / Solver.fs
Created September 3, 2017 19:47
Solver.fs
module Solver
open Board
// Takes a Value list in parameter and return a new list with all possible wich are duplicates of
// locked values removed
let removePossibleEntries (values:Value list) : Value list =
// printf "\nremovePossibleEntries entry %A" values
// get locked values
@gilles-leblanc
gilles-leblanc / Board.fs
Created September 3, 2017 19:43
Board.fs
module Board
type Value =
| Locked of int
| Possible of int List
type BoardSolved =
| Solved
| InvalidSolution
| BoardUnlocked
@gilles-leblanc
gilles-leblanc / namegen.fs
Created May 3, 2017 22:44
Name Generator for blog post
module NameLength
open System
open System.Configuration
open MathNet.Numerics.Distributions
// A record type that contains the mean and standard deviation of the names world length from an
// input file.
type NameLengthInfo = { mean:float; standardDeviation: float }
@gilles-leblanc
gilles-leblanc / OpenSimplexNoise.cs
Created March 30, 2017 17:52 — forked from digitalshadow/OpenSimplexNoise.cs
OpenSimplex Noise Refactored for C#
/* OpenSimplex Noise in C#
* Ported from https://gist.github.com/KdotJPG/b1270127455a94ac5d19
* and heavily refactored to improve performance. */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace NoiseTest
@gilles-leblanc
gilles-leblanc / reclaimWindows10.ps1
Created January 9, 2017 13:42 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <[email protected]>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
@gilles-leblanc
gilles-leblanc / PhoneModel.cs
Created October 20, 2016 02:59
Telephone Number Model to match database with NUMBER(10) phone field.
public class PhoneModel
{
public long PhoneNumber { get; set; }
private string _phoneString;
[DataType(DataType.PhoneNumber)]
public string PhoneString
{
get
module Tests
// modules under test
open HeightMap
open MidpointDisplacement
// assert functions
let assertAreEqual expected actual =
if expected <> actual then
sprintf "Test failed, expected %A, actual %A" expected, actual
{"source": "web-platform-tests", "thread": "MainThread", "time": 1446520493410, "action": "log", "message": "Using 8 client processes", "level": "INFO", "pid": 19718}
{"source": "web-platform-tests", "thread": "MainThread", "time": 1446520493418, "action": "log", "message": "Generating new CA in /tmp/tmpKJ2WiG", "level": "INFO", "pid": 19718}
{"thread": "MainThread", "process": "19898", "pid": 19718, "source": "web-platform-tests", "command": "/usr/bin/openssl req -config /tmp/tmpKJ2WiG/openssl.cfg -batch -new -newkey rsa:2048 -keyout /tmp/tmpKJ2WiG/cakey.pem -out /tmp/tmpKJ2WiG/careq.pem -subj /CN=web-platform-tests -passout pass:web-platform-tests", "time": 1446520493505, "action": "process_output", "data": "Generating a 2048 bit RSA private key\n...+++\n...............................................................+++\nwriting new private key to '/tmp/tmpKJ2WiG/cakey.pem'\n-----\n"}
{"thread": "MainThread", "process": "19899", "pid": 19718, "source": "web-platform-tests", "command": "/usr/bin/openssl ca -
@gilles-leblanc
gilles-leblanc / gist:f7a381bb559117a03753
Created May 10, 2015 18:04
Seven Languages in Seven Weeks: Ruby Day 1 i
# question 1
puts “Hello, world”