Skip to content

Instantly share code, notes, and snippets.

@banterCZ
banterCZ / JsfRedirectStrategy.java
Last active May 15, 2021 15:26
InvalidSessionStrategy when session expired and ajax request is done.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.web.session.InvalidSessionStrategy;
import org.springframework.util.StringUtils;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@mauriciogentile
mauriciogentile / sample1.cs
Created October 9, 2012 02:33
Mvc Web API on TopShelf
using System;
using System.Web.Http;
using System.Web.Http.SelfHost;
using Topshelf;
namespace MvcOnTopShelf
{
class Program
{
static void Main(string[] args)
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@lancscoder
lancscoder / DapperDinnerRepository.cs
Created February 19, 2012 10:54
DapperDinnerRepository
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Dapper;
using System.Data.Common;
namespace DapperDinner.Models
{
public class DapperDinnerRepository : IDinnerRepository