Skip to content

Instantly share code, notes, and snippets.

@kellishouts
kellishouts / gulp_sass_livereload.md
Last active January 24, 2022 06:40
Gulp + Sass + LiveReload 1.0

Gulp + Sass + LiveReload

This Gist goes over setting up a gulp workflow that will:

  1. watch for any sass changes, then compiles sass source into css
  2. watch for any changes in the public directory, and trigger live-reload
  3. serve static content in public/

@davidfowl
davidfowl / dotnetlayout.md
Last active May 21, 2024 20:15
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@ksafranski
ksafranski / Router.js
Last active June 15, 2020 11:59
Simple hash-based router with :params and 404
// Router object
var Router = function () {
var self = this;
// Watch hashchange
window.onhashchange = function () {
self.process();
};
// Run on load
@amanda-mitchell
amanda-mitchell / partial.Global.asax.cs
Last active September 12, 2022 11:48
Demonstrates how to decode an .ASPXAUTH cookie as generated by the current version of Microsoft's implementation of .NET. You should be able to drop this into the `Global.asax.cs` file of an ASP.NET project and be able to share cookies with code running on Mono. A few notes: (1) This assumes a machine key section that uses SHA1 validation and AE…
public void FormsAuthentication_OnAuthenticate(object sender, FormsAuthenticationEventArgs args)
{
var machineKeySection = (MachineKeySection) WebConfigurationManager.GetWebApplicationSection("system.web/machineKey");
var cookie = args.Context.Request.Cookies[".ASPXAUTH"];
if (cookie == null || !Regex.IsMatch(cookie.Value, "^([a-fA-F0-9]{2})+$"))
return;
var cookieBytes = ByteUtility.ToBytes(cookie.Value);
int signatureLength;