Skip to content

Instantly share code, notes, and snippets.

View marcofranssen's full-sized avatar
🏠
Diving into code

Marco Franssen marcofranssen

🏠
Diving into code
View GitHub Profile
@marcofranssen
marcofranssen / FromHexToColor.cs
Created November 11, 2012 19:07
Gists related to my "Windows Phone Theme colors" blogpost at http://marcofranssen.nl
public static Color FromHexa(string hexaColor)
{
return Color.FromArgb(
Convert.ToByte(hexaColor.Substring(1, 2), 16),
Convert.ToByte(hexaColor.Substring(3, 2), 16),
Convert.ToByte(hexaColor.Substring(5, 2), 16),
Convert.ToByte(hexaColor.Substring(7, 2), 16)
);
}
@marcofranssen
marcofranssen / companyVMContructor.js
Created December 9, 2012 16:11
Gists related to my "Knockout JS mappings" blogpost at http://marcofranssen.nl
function CompanyViewModel (data) {
var companyMapping = {
'ignore': ['address', 'website'],
'name': {
'create': function (options) {
return ko.observable(options.data.toUpperCase());
}
},
'employees': {
key: 'peronsId',
@marcofranssen
marcofranssen / ci.msbuild.cmd
Last active December 16, 2015 13:58
Gists belonging to my CI with Jenkins, MSBuild Nuget and Git part 1 blogpost http://marcofranssen.nl/ci-with-jenkins-msbuild-nuget-and-git-part-1/
@echo off
setlocal
set msbuild="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
set /p configChoice=Choose your build configuration (Debug = d, Release = r? (d, r)
if /i "%configChoice:~,1%" EQU "D" set config=Debug
if /i "%configChoice:~,1%" EQU "R" set config=Release
@marcofranssen
marcofranssen / ci.msbuild.clean.xml
Last active December 16, 2015 13:59
Gists belonging to my CI with Jenkins, MSBuild, Nuget and Git part 2 blogpost http://marcofranssen.nl/ci-with-jenkins-msbuild-nuget-and-git-part-2
<!-- The Clean Target -->
<ItemGroup>
<ProjectFiles Include="**\*.csproj" />
</ItemGroup>
<Target Name="Clean">
<Message Importance="high" Text="Cleaning folders"/>
<RemoveDir Directories="$(ReportsPath)" Condition="Exists('$(ReportsPath)')" />
<MakeDir Directories = "$(ReportsPath);$(ReportsPath)\MSpec;$(ReportsPath)\Coverage" />
<!-- Clean the source code projects -->
<MSBuild Projects="@(ProjectFiles)"
<PropertyGroup>
<!-- OpenCover -->
<!-- The tools path for OpenCover -->
<OpenCoverPath>$(Packages)\OpenCover.4.5.1403</OpenCoverPath>
<OpenCoverExe>OpenCover.Console.exe</OpenCoverExe>
<OpenCoverFilter>-[*Specs*]* +[*]*</OpenCoverFilter>
<ReportGeneratorPath>$(Packages)\ReportGenerator.1.8.1.0</ReportGeneratorPath>
<ReportGeneratorExe>ReportGenerator.exe</ReportGeneratorExe>
<Target Name="CI" DependsOnTargets="LoadNuGetPackages;Clean;Compile;CodeCoverage;Specs"></Target>
var colors = require('colors');
console.log('Hello '.red + 'Node.js'.green);
(function () {
'use strict';
var currentDate = new Date(),
christmas = Date.parse('Dec 25, ' + currentDate.getFullYear()),
newYear = Date.parse('Jan 1, ' + currentDate.getFullYear() + 1),
daysToChristmas = Math.round((christmas-today) / (1000 * 60 * 60 * 24)),
daysToNewYear = Math.round((newYear-today) / (1000 * 60 * 60 * 24));
if (daysToChristmas === 0) {
alert('Merry Christmas!');
grunt.registerTask('ci', ['jshint', 'concat', 'uglify', 'less', 'cssmin']);
@marcofranssen
marcofranssen / main.go
Last active June 13, 2019 18:25
Code not executing line 29 until interrupt channel is received
package main
import (
"flag"
)
var (
listenAddr string
)