Skip to content

Instantly share code, notes, and snippets.

View Xor-el's full-sized avatar
🏠
Working from home

Ugochukwu Mmaduekwe Xor-el

🏠
Working from home
View GitHub Profile
@Xor-el
Xor-el / .travis.yml
Created February 2, 2018 20:57 — forked from petrbel/.travis.yml
Travis-CI submodules
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior!
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
@Xor-el
Xor-el / BlogContext.cs
Created November 10, 2022 22:15 — forked from manoj-choudhari-git/BlogContext.cs
.NET Core - EF Core - Concurrency Check attribute and Fluent API
// Database Entity - User
public class User
{
public int Id { get; set; }
public string FirstName { get; set; }
// Data Annotation for specifying concurrency token
// Uncomment below line if you want to use data annotation instead of fluent API
// [ConcurrencyCheck]
@Xor-el
Xor-el / QueryableExtensions.cs
Created September 15, 2023 18:53 — forked from jacobsimeon/QueryableExtensions.cs
IQueryable Extensions for ordering by a property specified by a string
using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace JacobSimeon.Extensions
{
public static class IQueryableExtensions
@Xor-el
Xor-el / IQueryableExtensions.cs
Created November 24, 2023 15:58 — forked from ErikEJ/IQueryableExtensions.cs
Replacement for EF Core .Contains, that avoids SQL Server plan cache pollution
using System.Linq.Expressions;
namespace Microsoft.EntityFrameworkCore
{
public static class IQueryableExtensions
{
public static IQueryable<TQuery> In<TKey, TQuery>(
this IQueryable<TQuery> queryable,
IEnumerable<TKey> values,
Expression<Func<TQuery, TKey>> keySelector)
using System;
using System.Threading.Tasks;
namespace System.Collections.Concurrent
{
public static class ConcurrentDictionaryExtensions
{
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
@Xor-el
Xor-el / LaxVersusStrict.sql
Created April 16, 2024 23:03 — forked from bertwagner/LaxVersusStrict.sql
SQL Server 2016 JSON's Lax versus Strict modes
-- Lax (default: function will return an error if invalid JSON path specified
SELECT JSON_VALUE('{ "Color" : "Red" }', '$.Shape') --lax is the default, so you don't need to be explicitly state it
-- Output: NULL
SELECT JSON_VALUE('{ "Color" : "Red" }', 'lax $.Shape')
-- Output: NULL
-- Strict: function will return an error if invalid JSON path specified
SELECT JSON_VALUE('{ "Color" : "Red" }', 'strict $.Shape')
-- Output: Property cannot be found on the specified JSON path.
@Xor-el
Xor-el / google-docs-copy.js
Created April 20, 2024 14:21 — forked from Snarp/google-docs-copy.js
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
@Xor-el
Xor-el / gist:733de78e6c29c5c07eb441beb73c6e1a
Created May 11, 2024 18:36 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: