Skip to content

Instantly share code, notes, and snippets.

View CESARDELATORRE's full-sized avatar

Cesar De la Torre CESARDELATORRE

  • Microsoft Corp
  • Redmond, WA, U.S.
View GitHub Profile
@CESARDELATORRE
CESARDELATORRE / BoxStarter_CESARDL_Script.txt
Last active March 3, 2017 04:52
My Boxstarter Script (For CESARDL new boxes' setup)
Set-WindowsExplorerOptions -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst Microsoft-Hyper-V-All -source windowsFeatures
cisnt markdownmonster
cinst zoomit
cinst f.lux
cinst google-chrome-x64
cinst 7zip
cinst 7zip.install
cinst 1Password
@CESARDELATORRE
CESARDELATORRE / BoxStarter_Azure_Software.txt
Last active August 29, 2015 14:13
CESARDL Azure software to install in dev machines
Set-ExplorerOptions -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst azurestorageexplorer
@CESARDELATORRE
CESARDELATORRE / BoxStarter_Base_CESARDL_Script.txt
Last active August 29, 2015 14:13
My Boxstarter baseline script
Set-ExplorerOptions -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst zoomit
cinst adobereader
cinst disk2vhd
cinst f.lux
cinst google-chrome-x64
cinst azurestorageexplorer
cinst skype
@CESARDELATORRE
CESARDELATORRE / Example1.cs
Created June 28, 2016 21:41 — forked from davidfowl/Example1.cs
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@CESARDELATORRE
CESARDELATORRE / project.json
Created June 29, 2016 17:20
Sample project.json of ASP.NET Core 1.0 RTM supporting multiple frameworks
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
@CESARDELATORRE
CESARDELATORRE / ServiceFabricPartitionRangeKeys.cs
Last active July 1, 2016 01:50
This code tells you the Partition's Range Keys (High and Low) of your current partition in a Service Fabric Stateful Reliable Service
// This code can run in any Azure Service Fabric Stateful Reliable Service
// within the method protected override async Task RunAsync(CancellationToken cancellationToken)
//Aditional or similar code in: https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/blob/master/Services/WordCount/WordCount.WebService/Controllers/DefaultController.cs
var fabricClient = new FabricClient();
string serviceUri = "fabric:/MySFApp/MyStatefulService";
Uri serviceUriInstance = new Uri(serviceUri);
System.Fabric.Query.ServicePartitionList partitionList =
@CESARDELATORRE
CESARDELATORRE / git.migrate
Created October 10, 2016 18:51 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@CESARDELATORRE
CESARDELATORRE / git.migrate
Created October 10, 2016 19:52
Move your existing git repository # to a new remote repository
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
### OPTION 1 ###########################################################################################
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.WebMVC.Services
{
/// <summary>
/// When working with cloud services and Docker containers, it's very important to always catch
public async Task<Catalog> GetCatalogItems(int page,int take, int? brand, int? type)
{
_apiClient = new HttpClient();
var itemsQs = $"items?pageIndex={page}&pageSize={take}";
var filterQs = "";
if (brand.HasValue || type.HasValue)
{
var brandQs = (brand.HasValue) ? brand.Value.ToString() : "null";
var typeQs = (type.HasValue) ? type.Value.ToString() : "null";