Posts

Showing posts from October, 2016

CSS: How do I create a spinning 'loading' icon using an image

Image
The icon can be created using the following simple classes .loading{background:url(../img/loading-purple.gif) no-repeat center} .loading > div{display:none} Here is a sample image that could be used. Too easy. However, this is old school. You can create a simpler one using CSS and HTML5. Here is the CSS: .loading-container{display:block;width:100%;min-height:45%;margin-top:60px;text-align:center} .loader {margin:0 auto;text-align:center;width:200px;min-height:100%;display:block;vertical-align:middle} .loader:hover{opacity:1} .loading-spinning-bubbles{position:relative;margin:auto;min-height:1px} .loading-spinning-bubbles .bubble-container {position:absolute;top:calc(50% - 10px/2);left:calc(50% - 10px/2);transform-origin:-150% 50%;-webkit-transform-origin:-150% 50%;-moz-transform-origin:-150% 50%} .loading-spinning-bubbles .bubble-container .bubble {background:#00ac00;width:10px;height:10px;border-radius:50%;animation:bubble 1s infinite;-webkit-animation:bubble ...

Web API: How do I clean up the data in my HttpResponse?

There are some very simple web.config settings that can be applied to reduce the amount on unnecessary data returned in an HttpReponse and to minimise ways that hackers can hijack system information. Here is a quick snippet of web.config settings that may be useful. <Config> <system.web>  <httpRuntime enableVersionHeader="false" /> </system.web> <system.webServer> <httpProtocol>  <customHeaders> <add name="Strict-Transport-Security" value="778000; includeSubdomains" /> <add name="X-Content-Type-Options" value="nosniff" /> <add name="X-Permitted-Cross-Domain-Policies" value="none" /> <add name="X-XSS-Protection" value="1; mode=block" /> <add name="Cache-Control" value="no-store" /> <add name="Pragma" value="no-cache" /> <remove name...