Skip to content

Instantly share code, notes, and snippets.

Esfand esfand

Block or report user

Report or block esfand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
esfand /
Last active Sep 3, 2019
Serving Static Content with Nginx

OFBiz or Bonsai ERP, and nginx

Submitted by anne on 10 Oct 2011

OFBiz can quite happily service all http and https requests on its own, and many people run it this way.

However there are many possible reasons why you might want to put OFBiz behind a traditional http server, such as Apache. Perhaps you want to more efficiently serve static resources, or manage virtual domains, or restrict access in complicated ways, or also serve php or cgi pages.

Typically OFBiz is placed behind Apache using a connector such as mod_proxy_ajp, as documented at How To Httpd .

esfand /
Created May 28, 2018 — forked from ajumell/
Webfaction Magento Insatll script.
#!/bin/env python2.4
"autostart": not applicable
"extra info": Do you agree to Magento's license?
esfand / utf8.c
Created Aug 14, 2019 — forked from stanislaw/utf8.c
Some C functions to work with UTF-8 string : you can check if a string is valid UTF-8, get the length of a UTF-8 string and replace things in a UTF-8 string. All `char *` arguments must be regular, null-byte terminated, C strings. I've tried to optimize the best I could. I'd be grateful for any suggestions or improvements. Please note I have onl…
View utf8.c
// utf8.c
// training
// Created by Conrad Kleinespel on 5/27/13.
// Copyright (c) 2013 Conrad Kleinespel. All rights reserved.
#include <stdio.h>
#include <stdlib.h>

Redirect: Temporary and Permanent


What is an HTTP Redirect?

HTTP redirection, or URL redirection, is a technique of pointing one domain or address to another. There are many uses for redirection, and a few different kinds of redirection to consider.

As you create content and administrate servers, you will often find the need to redirect traffic from one place to another. This guide will discuss the different use-cases for these techniques, and how to accomplish them in Apache and Nginx.

View angular-jqlite.adoc

Angular jqLite

jQuery and Angular

Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite. Still, when Angular detects the presence of a jQuery version in your page, it uses that full jQuery implementation in lieu of jqLite. One direct way in which this manifests itself is with Angular’s element abstraction. For example, in a directive you get access to the element that the directive applies to:

esfand /
Last active Jul 8, 2019
Java Final Field Deserialization with readobject

Java Serialization & final class attributes

The SmartWeb BusinessObject class defines a protected attribute named logger carrying the logger for subclasses. The BusinessObject class implements Serializable thus it needs to define the logger attribute as transient because Commons Logging loggers are non serializable.

The problem arises whenever you deserialize a BusinessObject subclass because the logger attribute will not be deserialized (it has not be serialized at all!)

esfand /
Last active Apr 10, 2019
Nginx Variables

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent, $http_cookie, and so on. Also there are other variables:

  • $arg_name
    argument name in the request line
View MSBuild Batching 1.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- MSBuild Batching -->
<Project xmlns="">
<fruit Include="apple">
<fruit Include="orange">
esfand / typescript_angular.adoc
Last active Feb 16, 2019
AngularJS with TypeScript
View typescript_angular.adoc
esfand /
Last active Feb 7, 2019
Spring Custom UserDetails

How to use Custom DAO class in Spring Security


  • Objective 1 : Use Custom DAO classes in Spring Security Spring Security provides mechanism by which we can specify database queries in spring security xml file , but sometimes we want to use our own custom dao classes which are already built.
  • Objective 2 : Forward the request to different home pages based on the authorized role
You can’t perform that action at this time.