Skip to content

Instantly share code, notes, and snippets.

View alexb5dh's full-sized avatar
☄️
Creating things

Alex alexb5dh

☄️
Creating things
View GitHub Profile
@L3n1n
L3n1n / SteamSummerSaleCheatEventBadge2022.user.js
Last active June 28, 2022 07:08
Steam Summer Sale Cheat Event Badge 2022
// ==UserScript==
// @name Steam Summer Sale Cheat Event Badge 2022
// @namespace https://gist.github.com/L3n1n
// @version 0.61
// @description Automatic finding
// @author L3n1n
// @match *://store.steampowered.com/sale/clorthax_quest*
// @updateURL https://gist.githubusercontent.com/L3n1n/3248f42b6e4fd4500c26f0311443300d/raw/SteamSummerSaleCheatEventBadge2022.user.js
// @downloadURL https://gist.githubusercontent.com/L3n1n/3248f42b6e4fd4500c26f0311443300d/raw/SteamSummerSaleCheatEventBadge2022.user.js
// ==/UserScript==
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@guardrex
guardrex / nutjob-webhostbuilder-pattern.cs
Last active September 2, 2017 15:03
My "NUTJOB" WebHostBuilder Pattern
/*
The purpose of this pattern is to consolidate all application
configuration into just ONE file and configure the app based
on the server/dev environment where it finds itself. It removes
the need for environment variables and/or JSON config files on
individual machines.
*/
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
@aras-p
aras-p / preprocessor_fun.h
Last active September 8, 2024 07:43
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@atenni
atenni / README.md
Last active September 14, 2024 02:04
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@craiggwilson
craiggwilson / gist:5217295
Created March 21, 2013 22:15
Convention to automatically persist string identifiers as ObjectId's in MongoDB.
using System.Diagnostics;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;
using MongoDB.Bson.Serialization.Conventions;
using MongoDB.Bson.Serialization.IdGenerators;
using MongoDB.Driver;
namespace ConsoleApplication1
{
class Program
@mathiasbynens
mathiasbynens / toggleAttr() jQuery plugin
Created February 8, 2010 21:20
toggleAttr() jQuery plugin
/*!
* toggleAttr() jQuery plugin
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc…
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
jQuery.fn.toggleAttr = function(attr) {
return this.each(function() {
var $this = $(this);
$this.attr(attr) ? $this.removeAttr(attr) : $this.attr(attr, attr);