Skip to content

Instantly share code, notes, and snippets.

@squaredice
squaredice / Dockerfile
Created February 2, 2018 08:11
Dockerfile for build image with Nemesida Scanner
Dockerfile
----------------------------------------------------------------------------------------------------------------------
FROM debian
RUN apt-get update &&\
apt-get upgrade -y &&\
apt-get dist-upgrade -y &&\
apt install wget -y &&\
apt-get update && apt-get install apt-transport-https -y &&\
echo "deb https://nemesida-security.com/ns/debian stretch non-free" > /etc/apt/sources.list.d/NemesidaScanner.list &&\
apt install gnupg -y &&\
@werwolfby
werwolfby / <Custom>DbContext.cs
Last active September 16, 2024 11:32
EF Core DateTime Utc kind
public class CustomDbContext : DbContext
{
// ...
protected override void OnConfiguring(DbContextOptionsBuilder options)
{
// Replace default materializer source to custom, to convert DateTimes
options.ReplaceService<IEntityMaterializerSource, DateTimeKindEntityMaterializerSource>();
base.OnConfiguring(options);
@jermdavis
jermdavis / Install-Solr.ps1
Last active November 23, 2021 13:30
A PowerShell script to help installing Solr as a service - See https://blog.jermdavis.dev/posts/2017/low-effort-solr-installs for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@joshschmelzle
joshschmelzle / remove-gamebar-powershell-win10.md
Last active May 13, 2025 14:25
How to Remove the Xbox Game Bar with Powershell on Windows 10. Scroll to the end of the gist for Windows 11.

You've probably stumbled upon this researching how to remove the Xbox Game Bar. This gist includes a few different methods you can try. Please note that some of these first options are probably not be available unless you are running an older version of Windows 10.

EDIT: make sure to check out the comment below from @nmhung1985 which seems to be working for most folks.

Uninstalling/Removing the Game Bar (old Windows 10 build GUI options)

(this is no longer an option on any recent Windows 10 build)

  1. Press Windows Key or click on the Start menu.
  2. Start typing Xbox or Game Bar, until you get the Xbox Game Bar app to appear in the results.
@Vertigo093i
Vertigo093i / bamboo-git-lfs-checkout
Last active October 11, 2020 22:45
Howto: Atlassian Bamboo and Git LFS
"${bamboo.capability.system.git.executable}" config remote.origin.lfsurl ${bamboo.planRepository.repositoryUrl}
"${bamboo.capability.system.git.executable}" lfs install --local
"${bamboo.capability.system.git.executable}" lfs pull || "${bamboo.capability.system.git.executable}" lfs logs last
@Danielku15
Danielku15 / Example.html
Created February 25, 2016 19:53
A MediaTypeFormatter for WebApi for multipart/form-data including file uploads
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>File Upload example</title>
<link href="/Content/bootstrap.css" rel="stylesheet" />
</head>
<body>
<form action="api/Upload" method="post">
<div class="form-group">
@mariusschulz
mariusschulz / HtmlHelperExtensions.cs
Last active November 15, 2022 21:54
Two C# extension methods for inlining script and style bundles into the HTML response using ASP.NET MVC and the System.Web.Optimization framework.
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
public static class HtmlHelperExtensions
{
public static IHtmlString InlineScripts(this HtmlHelper htmlHelper, string bundleVirtualPath)
{
return htmlHelper.InlineBundle(bundleVirtualPath, htmlTagName: "script");
@dnozay
dnozay / README.md
Last active April 21, 2025 13:21
Collection of useful stuff for interacting with gitlab.

Reset root/admin password

Lost the root/admin password? You can reset it using the command-line. Recipe adapted from gitlab issue #308.

# start the console
sudo gitlab-rails console
@mmozeiko
mmozeiko / win32_crt_float.cpp
Last active April 28, 2025 19:10
Visual C/C++ CRT functionality
extern "C"
{
int _fltused;
#ifdef _M_IX86 // following functions are needed only for 32-bit architecture
__declspec(naked) void _ftol2()
{
__asm
{
@davidfowl
davidfowl / dotnetlayout.md
Last active May 9, 2025 16:45
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/