Skip to content

Instantly share code, notes, and snippets.

@guneysus
guneysus / delete-with-select.cs
Created Sep 8, 2021 — forked from tombowers/delete-with-select.cs
Entity Framework - Update without Select
View delete-with-select.cs
var id = 1;
using (var db = new entityContext())
{
// Select entity
var entity = db.dbset.FirstOrDefault(e => e.ID == id);
if (entity != null)
{
// Remove Entity
db.dbset.Remove(entity);
db.SaveChanges();
@guneysus
guneysus / .editorconfig
Created May 24, 2021 — forked from bryanknox/.editorconfig
.editorconfig for C# Visual Studio projects
View .editorconfig
# EditorConfig is awesome: https://EditorConfig.org
#
# More info about editorconfig for C# and .NET in Visual Studio see:
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2019
#
# Most of the .NET and C# rules below were taken from the
# Microsoft Roslyn team's editorconfig at:
# https://github.com/dotnet/roslyn/blob/master/.editorconfig
# Top-most EditorConfig file.
@guneysus
guneysus / disable_spectre.md
Created May 23, 2021 — forked from rizalp/disable_spectre.md
Disable Spectre/Meltdown Mitigation
View disable_spectre.md

In /etc/default/grub, modify:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off"

Then sudo update-grub

@guneysus
guneysus / profile.ps1
Created Feb 22, 2021 — forked from bradwilson/profile.ps1
Downloadable files for bradwilson.io/blog/prompt/powershell
View profile.ps1
######## POSH-GIT
# ... Import-Module for posh-git here ...
# Background colors
$GitPromptSettings.AfterStash.BackgroundColor = 0x3465A4
$GitPromptSettings.AfterStatus.BackgroundColor = 0x3465A4
$GitPromptSettings.BeforeIndex.BackgroundColor = 0x3465A4
$GitPromptSettings.BeforeStash.BackgroundColor = 0x3465A4
@guneysus
guneysus / profiles.json
Created Feb 22, 2021 — forked from bradwilson/settings.json
Ubuntu color scheme for Windows Terminal
View profiles.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"tabWidthMode": "titleLength",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"copyOnSelect": false,
"copyFormatting": false,
"profiles": {
"defaults": {
"acrylicOpacity": 1,
"antialiasingMode": "grayscale",
@guneysus
guneysus / fancy-tabs-demo.html
Created Feb 12, 2021 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
View fancy-tabs-demo.html
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
@guneysus
guneysus / memory_docs_samples.md
Created Jul 20, 2020 — forked from GrabYourPitchforks/memory_docs_samples.md
Memory<T> API documentation and samples
View memory_docs_samples.md

Memory<T> API documentation and samples

This document describes the APIs of Memory<T>, IMemoryOwner<T>, and MemoryManager<T> and their relationships to each other.

See also the Memory<T> usage guidelines document for background information.

First, a brief summary of the basic types

  • Memory<T> is the basic type that represents a contiguous buffer. This type is a struct, which means that developers cannot subclass it and override the implementation. The basic implementation of the type is aware of contigious memory buffers backed by T[] and System.String (in the case of ReadOnlyMemory<char>).
View contribs-with-repo-descriptions.gql
{
viewer {
createdAt
repositoriesContributedTo(last: 100, orderBy: {field: STARGAZERS, direction: DESC}, includeUserRepositories: false, contributionTypes: [COMMIT, ISSUE, REPOSITORY, PULL_REQUEST, PULL_REQUEST_REVIEW]) {
nodes {
primaryLanguage {
name
color
}
nameWithOwner
View MSSQL executed query history
USE master
go
SELECT sdes.database_id
,sdes.[host_name]
,sdes.[program_name]
,sdes.login_name
,sdes.login_time
,sdec.client_net_address
,sdec.local_net_address
,sdest.Query