Skip to content

Instantly share code, notes, and snippets.

Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst Microsoft-Hyper-V-All -source windowsFeatures
cinst IIS-WebServerRole -source windowsfeatures
cinst git-credential-winstore
cinst notepadplusplus.install
cinst 7zip.install
cinst sql-server-management-studio

Keybase proof

I hereby claim:

  • I am tiagosalgado on github.
  • I am tiagosalgado (https://keybase.io/tiagosalgado) on keybase.
  • I have a public key ASDIHXTF5QAyG2NpNcFTiiAqfjCqUMgwA-Sj4gP0dcoJ_Ao
@tiagosalgado
tiagosalgado / vs_solution_files_cleanup.ps1
Created February 9, 2018 22:38
Cleanup VS solution files
Get-ChildItem -inc bin,obj,node_modules,packages,*.suo,*.*scc,.vs,*.user -rec | Remove-Item -rec -force
@tiagosalgado
tiagosalgado / CacheDelete.cs
Created October 17, 2017 08:25
delete all or single key
public void Delete(string key = null)
{
var endpoints = Connection.GetEndPoints();
foreach (var endpoint in endpoints)
{
var server = Connection.GetServer(endpoint);
if (string.IsNullOrWhiteSpace(key))
{
var keys = server.Keys(pattern: $"{_options.InstanceName}*", pageSize: 2000);
foreach (var k in keys)
@tiagosalgado
tiagosalgado / gist:733e82ff47069eb4cad26f28926536c4
Created October 10, 2017 21:33
VSTS build / nuget restore fails
GatewayTimeout https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.razor/2.0.0/microsoft.aspnetcore.mvc.razor.2.0.0.nupkg 17ms
Failed to download package 'Microsoft.AspNetCore.Mvc.Razor.2.0.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.razor/2.0.0/microsoft.aspnetcore.mvc.razor.2.0.0.nupkg'.
Response status code does not indicate success: 504 (Gateway Timeout).
GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.razor/index.json
GET https://<our_internal_nuget_server>/nuget/FindPackagesById()?id='Microsoft.AspNetCore.Mvc.Razor'
GET https://<our_internal_nuget_server>/nuget/FindPackagesById()?id='Microsoft.AspNetCore.Mvc.Razor'
CACHE https://<our_internal_nuget_server>/nuget/FindPackagesById()?id='System.IO.Compression'
CACHE https://api.nuget.org/v3-flatcontainer/system.threading.thread/index.json
NuGet.Protocol.Core.Types.FatalProtocolException: The feed 'Nuget [https://api.nuget.org/v3/index.json]' lists package 'System.Threading.Thread.4.3.0'
@tiagosalgado
tiagosalgado / DnnNavigateModules.cs
Created September 22, 2017 08:11
Navigate between modules on DotNetNuke
var tabController = new DotNetNuke.Entities.Tabs.TabController().GetTabsByPortal(this.PortalId);
var tab = tabController
.Where(t => string.Equals(t.Value.TabName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
if (!tab.Equals(default(KeyValuePair<int, DotNetNuke.Entities.Tabs.TabInfo>)))
{
var childModules = tab.Value.ChildModules
.Where(p => string.Equals(p.Value.DesktopModule.FriendlyName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
var url = Globals.NavigateURL(
<!DOCTYPE html>
<html>
<head>
<script src="http://github.hubspot.com/offline/offline.min.js"></script>
<script src="http://github.hubspot.com/offline/js/snake.js"></script>
<link rel="stylesheet" href="http://github.hubspot.com/offline/themes/offline-theme-chrome.css" />
<script>
Offline.options = {
@tiagosalgado
tiagosalgado / 0_reuse_code.js
Created October 25, 2013 15:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var tabController = new DotNetNuke.Entities.Tabs.TabController().GetTabsByPortal(this.PortalId);
var tab = tabController
.Where(t => string.Equals(t.Value.TabName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
if (!tab.Equals(default(KeyValuePair<int, DotNetNuke.Entities.Tabs.TabInfo>)))
{
var childModules = tab.Value.ChildModules
.Where(p => string.Equals(p.Value.DesktopModule.FriendlyName,"ModuleFriendlyName", StringComparison.InvariantCultureIgnoreCase))
.FirstOrDefault();
private List<CustomFile> fileList;
void Main()
{
fileList = LoadFiles();
var filesToAdd = new List<CustomFile>() {
new CustomFile { FileName = "file.txt", owner = @"domain\user" },
new CustomFile { FileName = "file1", owner = @"domain\user" },
new CustomFile { FileName = "file.txt", owner = @"domain\user" }
};