Skip to content

Instantly share code, notes, and snippets.

View OliverRC's full-sized avatar
🤩
coding my heart out

Oliver Rivett-Carnac OliverRC

🤩
coding my heart out
View GitHub Profile
@OliverRC
OliverRC / delete-reddit-comments.js
Created October 19, 2022 19:33
Quick script to use on old.reddit.com to delete comments and posts.
var $domNodeToIterateOver = $('.del-button .option .yes'), currentTime = 0, timeInterval = 1500; $domNodeToIterateOver.each(function() { var _this = $(this); currentTime = currentTime + timeInterval; setTimeout(function() { _this.click(); }, currentTime);});
@OliverRC
OliverRC / Program.cs
Created June 21, 2022 18:09
Secure AspNetCore .NET 6 API with Auth0 - Works with SwaggerUI
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
@OliverRC
OliverRC / code-first-migration
Created November 4, 2013 08:05
Code First Migration
Add-Migration {name}
@OliverRC
OliverRC / view-template.sql
Created October 25, 2013 11:24
View Template
IF EXISTS(SELECT * FROM sysobjects where id = object_id(N'<schema>.<view>') and OBJECTPROPERTY(id, N'IsView') = 1)
DROP VIEW <schema>.<view>
GO
CREATE VIEW dbo.vw_Mon_Casino
AS
GO
@OliverRC
OliverRC / stored-procedure-template.sql
Created October 25, 2013 11:23
Stored Procedure Template
IF EXISTS(SELECT * FROM sysobjects where id = object_id(N'<schema>.<procedureName>') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE <schema>.<procedureName>
GO
CREATE PROCEDURE <schema>.<procedureName> <@parameters
AS
BEGIN
END
@OliverRC
OliverRC / cte.sql
Created October 25, 2013 09:00
Common Table Expression or CTE
;WITH cte_1 AS
(
)
@OliverRC
OliverRC / table-variable.sql
Created October 25, 2013 09:01
Table Variable
DECLARE @ProductTotals TABLE
(
ProductID int,
Revenue money
)
@OliverRC
OliverRC / chained-cte.sql
Created October 25, 2013 09:00
Chained CTE
;WITH cte_1 AS
(
),cte_2 AS
(
)
@OliverRC
OliverRC / custom-errors.xml
Created October 8, 2013 13:27
Custom Errors Asp.NET
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
@OliverRC
OliverRC / no-wrap.css
Created October 8, 2013 11:29
No Wrap
white-space: nowrap;