Skip to content

Instantly share code, notes, and snippets.

View anil-kk's full-sized avatar

Anil Kumar Kothapalli anil-kk

View GitHub Profile
@nepsilon
nepsilon / how-to-create-a-read-only-user-for-your-database.md
Last active March 20, 2019 10:31
How to create a read-only user for your database? — First published in fullweb.io issue #97

How to create a read-only user for your database?

If your app is about searching (business directories, dictionaries, etc) or a catalog of browsable items, it’s always a good idea to let your API use a read-only database user. Another use case would be for doing backups, no write permissions needed either.

Here is how to do that for PostgreSQL v9.0+ (syntax quasi-similar for MySQL):

-- Say we just created the user "pouet"

-- Allow the user to CONNECT
GRANT CONNECT ON DATABASE mydb TO pouet;
@btroncone
btroncone / ngrxintro.md
Last active June 26, 2024 08:27
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@dazinator
dazinator / FormsAuthenticationTicketHelper.cs
Last active December 27, 2023 09:46
Decrypt a Legacy ASP.NET Forms Authentication Cookie (that uses SHA1 validation, and AES encryption) - without horrendous dependencies on system.web.. This allows you to decrypt a forms authentication cookie that was created in ASP.NET 3.5, from an ASP.NET 5 application.
internal static class FormsAuthenticationTicketHelper
{
private const byte CURRENT_TICKET_SERIALIZED_VERSION = 0x01;
private const int MAX_TICKET_LENGTH = 4096;
// Resurrects a FormsAuthenticationTicket from its serialized blob representation.
// The input blob must be unsigned and unencrypted. This function returns null if
// the serialized ticket format is invalid. The caller must also verify that the
// ticket is still valid, as this method doesn't check expiration.
@staltz
staltz / introrx.md
Last active July 31, 2024 09:30
The introduction to Reactive Programming you've been missing