Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Sonntag Compufreak345

View GitHub Profile
View Swap connection string on runtime EFCore
// ConfigureServices
var connectionStringProvider = new ConnectionStringProvider<WebApiDbContext>("ConnectionString");
services.AddSingleton(connectionStringProvider);
services.AddDbContext<WebApiDbContext>((s, o) => o.UseSqlite(
s.GetService<ConnectionStringProvider<WebApiDbContext>>().ConnectionString));
// Singleton provider for connection string (or other DbContextOptions)
public class ConnectionStringProvider<TContext> where TContext : DbContext
View Steam_HideScreenshotsFromActivityFeed.js
// Friends with names containing this strings will be removed from screenshots:
var usersToHide=["pegnuin","Name2","Name3"];
// Games with names containing this strings will be removed from screenshots:
var gamesToHide=["Civilization","Spiel2","Spiel3"];
function hideScreenshot(hrefMatcher, contentMatcher) {
jQuery("#blotter_content").find("div.blotter_screenshot:has(div.blotter_author_block:has(a[href*='"+hrefMatcher+"']:contains('"+contentMatcher+"')))").hide();
}
function hideScreenshots() {
jQuery.each(usersToHide, function(i,v) {
hideScreenshot("/id/",v);