Skip to content

Instantly share code, notes, and snippets.

View xoofx's full-sized avatar
🏠
Working from home

Alexandre Mutel xoofx

🏠
Working from home
View GitHub Profile
@xoofx
xoofx / FileTrackerTest.cs
Created January 15, 2013 14:23
Tracking read and write files by current process using FileTracker available from Microsoft.Build.Utilities.v4.0 assembly
using System.IO;
using Microsoft.Build.Utilities;
namespace TestFileTracker
{
class Program
{
static void Main(string[] args)
{
@xoofx
xoofx / JSDL1.yaml
Last active December 24, 2015 02:19
This is a translation of the JSDL sample from the JSON Description Language http://area.autodesk.com/blogs/chris/json-scene-description-language. You can copy paste the following YAML grammar on an online YAML parser (like http://yaml-online-parser.appspot.com/ )
# YAML Version of the JSDL Autodesk example http://area.autodesk.com/blogs/chris/json-scene-description-language
# This version is using flow nodes [ ] { } like JSON but is less verbose by removing all double quotes
{
id: my_scene,
roots: [
{
assets: [Square],
children: [
{
transform:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.ServiceModel.Dispatcher;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.Graphics.Display;
using Windows.Storage;
using Windows.Storage.Pickers;
@xoofx
xoofx / github_webhook_received.js
Created October 7, 2014 13:43
github webhook received sample (POST)
{
"action": "reopened",
"number": 3,
"pull_request": {
"url": "https://api.github.com/repos/xoofx/SharpCLABot/pulls/3",
"id": 22243469,
"html_url": "https://github.com/xoofx/SharpCLABot/pull/3",
"diff_url": "https://github.com/xoofx/SharpCLABot/pull/3.diff",
"patch_url": "https://github.com/xoofx/SharpCLABot/pull/3.patch",
"issue_url": "https://api.github.com/repos/xoofx/SharpCLABot/issues/3",
@xoofx
xoofx / ShrinkAllPdfs.bat
Created January 2, 2015 08:46
Shrink all pdf files in a folder (Windows)
@echo off
REM Install Ghostscript 64bit from http://www.ghostscript.com/download/gsdnld.html
REM Shrink all pdfs files in the current directory where this script is run and output to the
REM compressed sub-folder
setlocal
set GS_BIN=C:\Program Files\gs\gs9.15\bin\gswin64c.exe
set GS_OUTPUT_DIR=compressed
mkdir %GS_OUTPUT_DIR%
for %%i in (*.pdf) do "%GS_BIN%" -dNOPAUSE -dBATCH -dSAFER -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -sDEVICE=pdfwrite -sOutputFile="%GS_OUTPUT_DIR%\%%i" "%%i"
@xoofx
xoofx / TestCodeGen.cs
Created September 8, 2015 14:45
Simple CodeDom vs Roslyn syntax comparison
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.IO;
using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Formatting;
using NUnit.Framework;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
using System;
public struct ValueBase
{
public int A;
public int B;
public int Calculate()
{
<!--
***********************************************************************************************
Microsoft.Common.CurrentVersion.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines the steps in the standard build process for .NET projects. It
contains all the steps that are common among the different .NET languages, such as
@xoofx
xoofx / Microsoft.Common.CurrentVersion.js
Created May 12, 2016 15:26
Microsoft.Common.CurrentVersion.targets with a DSL
/***********************************************************************************************
Microsoft.Common.CurrentVersion.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines the steps in the standard build process for .NET projects. It
contains all the steps that are common among the different .NET languages, such as
Visual Basic, and Visual C#.
Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************/
@xoofx
xoofx / ProgramInlineAsm.cs
Created May 25, 2016 03:08
Shows how to use the prototype inline IL ASM with Roslyn
using System;
using System.IO;
using System.Runtime.CompilerServices;
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Method)]
internal class CompilerIntrinsicAttribute : Attribute { }
}