Skip to content

Instantly share code, notes, and snippets.

View ChocolateyScript.txt
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
View keybase.md

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
View vs_solution_files_cleanup.ps1
Get-ChildItem -inc bin,obj,node_modules,packages,*.suo,*.*scc,.vs,*.user -rec | Remove-Item -rec -force
@tiagosalgado
tiagosalgado / CacheDelete.cs
Created Oct 17, 2017
delete all or single key
View CacheDelete.cs
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)
View gist:733e82ff47069eb4cad26f28926536c4
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 Sep 22, 2017
Navigate between modules on DotNetNuke
View DnnNavigateModules.cs
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(
View demo_offlinejs
<!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 Oct 25, 2013
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View DNN_NavigateModules
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();
View gist:4484413
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" }
};
You can’t perform that action at this time.