weboideas

Month

February 2013

1 post

Using static constructor to initialize classes before using static methods

If you ever need to initialize a class before calling its static member you can use “static constructor”… Like the example code below:

    public class Email
    {

        public static string MailServer { get; set; }

        …

        static Email()
        {

            MailServer = ConfigurationManager.AppSettings.Get(“Common.Email.MailServer”);

            …

        }

        public static bool SendEmail(
            List<string> toList,
            string subject,
            string mailContentHtml)
        {

             …

        }

}

A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only. It is called automatically before the first instance is created or any static members are referenced.

More Information: http://msdn.microsoft.com/en-us/library/k9x6w0hc(v=vs.80).aspx

Feb 5, 2013
#c

January 2013

1 post

WebSecurity.CreateUserAndAccount Sql Collation Issue

If you experience WebSecurity.CreateUserAndAccount throwing the following error when called follow my recommendation:

“the provider encountered an unknown error”

This is related with the bug in WebSecurity.CreateUserAndAccount:

If Sql Server database collation is Turkish_CI_AS, I get that error at below cause UPPER function in SELECT Query in “GetUserId” method in SimpleMembershipProvider.cs class.

SQL UPPER(‘info’) is not equal to “info”.ToUpperInvariant() in Turkish_CI_AS

For a work around do the following:

Change the collation of UserProfile.UserName column in DB from Turkish_CI_AS to Latin1_General_CI_AS or any other at the moment. So, this must be bug.

Jan 30, 2013
#asp.net mvc #sqlserver

May 2012

1 post

Beautify, unpack or deobfuscate JavaScript and HTML → jsbeautifier.org

To see what is going on in those minified, one-line javascripts…

May 14, 2012
#javascript #hrml #webdevelopment

March 2012

2 posts

10 Million hits a day with WordPress using a $15 server → ewanleith.com

These instructions are the rather verbose, but hopefully easy enough to follow, steps to build a new Linux server using Varnish, Nginx, W3 Total Cache, and WordPress, to build a WordPress blog on a Amazon Micro server (or equivalent), all costing under $15 a month.

Mar 31, 2012
#amazon-ec2 #wordpress
Closure Compiler → closure-compiler.appspot.com

A useful tool from Google to compile and minimize JavaScript code…

It is also part of Page Speed tools of Google…

Official Desc: The Closure Compiler is a tool for making JavaScript download and run faster. It is a true compiler for JavaScript. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls.

Mar 11, 20121 note
#webdevelopment #javascript #cloud

February 2012

1 post

ASP.NET MVC Mini Profiler → code.google.com

 It provides:

  • An ADO.NET profiler, capable of profiling calls on raw ADO.NET (SQL Server, Oracle, etc), LINQ-to-SQL, EF / “Code First”, LightSpeed and a range of other data access scenarios
  • A pragmatic Step instrumentation that you can add to code you want to explicitly profile

MVC Mini Profiler was designed by the team at Stack Overflow. It is in production use there and on the Stack Exchange family of sites.

Feb 7, 20121 note
#asp.net mvc #performance

December 2011

3 posts

HTML5 and CSS3 Advent 2011 → html5advent2011.digitpaint.nl

Welcome to our advent calendar. Every day in december 2011 (until the 24th) we will post new cool HTML5 and CSS3 techniques here. These techniques may not work yet in all browsers because they are part of not quite finished specs. This also means that you may not be able to view all of the examples, but we’ll always tell you in which browser it actually does work.

Dec 21, 201113 notes
#webdesign #css3 #html5 #blog
The 50 Most Useful jQuery Plugins from 2011 → speckyboy.com

With this post we have highlighted the 50 plugins that, we feel, are not only the most useful and popular from the this year, but also the most ground-breaking. To help you find a specific solution, we have split all of the plugins into the following categories: Form & Validation Plugins, Plugins for Responsive Layouts, Sliders, Galleries & Carousels, Modal Window Plugins, Mobile Specific Plugins, Web Typography Plugins, Animation Plugins and finally everything in-between.

Dec 15, 20115 notes
#webdevelopment #javascript #jquery
Redis Tutorial → simonwillison.net

Hitting a database every few seconds is expensive. Hitting Redis every few seconds (even for thousands of concurrent users) is no problem at all.

Nice tutorial about Redis and its usage in various areas…

Dec 2, 201113 notes
#webdevelopment #nosql

November 2011

10 posts

A Django Application Structure

I have taken this information from Simon Willison’s (co-creator of the Django Web framework) personal web log. I think it gives a good idea for configuring a django application:

This site runs on a custom weblog application written in Python using Django. It is hosted by mod_python running on Apache 2 behind nginx, on an Ubuntu Virtual Machine at Bytemark. The database is MySQL 4.
Dynamic images are created using the Python Imaging Library. ElementTree is used throughout for munging XML.
The search engine is powered by hyperestraier, running as a local Web service. OpenID support is built around the JanRain Python library. Version control is handled by Bazaar.
Atom feeds are served by FeedBurner. Photos are hosted on Flickr, and pulled in using the Flickr API.

Nov 30, 20117 notes
#webdevelopment #python #django
How to Become a Better Programmer → dodgycoder.net

Nice tips for software developers…

Nov 28, 20111 note
#webdevelopment #blog
Celery: Distributed Task Queue → celeryproject.org

Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.

These are some common use cases:

  • Running something in the background. For example, to finish the web request as soon as possible, then update the users page incrementally. This gives the user the impression of good performance and “snappiness”, even though the real work might actually take some time.
  • Running something after the web request has finished.
  • Making sure something is done, by executing it asynchronously and using retries.
  • Scheduling periodic work.

And to some degree:

  • Distributed computing.
  • Parallel execution.

My note: It can be useful in Django projects…

More information on Queues: http://decafbad.com/blog/2008/07/04/queue-everything-and-delight-everyone

Nov 24, 20114 notes
#webdevelopment #python #django
Nice CSS3 <hr> Styles → jsfiddle.net

Some nice <hr> styles by Chris Coyier. They work on Chrome but not in IE8 (as expected)

body {
   padding: 50px;    
}
hr {
   margin: 50px 0;   
}
hr.style-one {
    border: 0;
    height: 1px;
    background: #333;
    background-image: -webkit-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:    -moz-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:     -ms-linear-gradient(left, #ccc, #333, #ccc); 
    background-image:      -o-linear-gradient(left, #ccc, #333, #ccc); 
}
hr.style-two {
    border: 0;
    height: 1px;
    background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:    -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:     -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
    background-image:      -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.75), rgba(0,0,0,0)); 
}
hr.style-three {
    border: 0;
    border-bottom: 1px dashed #ccc;
    background: #999;
}
hr.style-four {
    height: 6px;
    border: 0;
    box-shadow: inset 0 6px 6px -6px black;
}
hr.style-five {
    border: 0;
    height: 0;
    box-shadow: 0 0 10px 1px black;
}
 
<!— Gradient color1 - color2 - color1 —>
<hr class=”style-one”>
<!— Gradient transparent - color - transparent —>
<hr class=”style-two”>
<!— Double-color dashed line —>
<hr class=”style-three”>
<!— Single-direction drop shadow —>
<hr class=”style-four”>
<!— Cloud —>
<hr class=”style-five”>

Nov 24, 20114 notes
#webdesign #css3
JavaScripture - API Reference for JavaScript → javascripture.com

A definitive API reference for JavaScript.

Each reference page contains detailed descriptions and examples you can modify and run to quickly learn by doing.

Worth noting… 

Nov 23, 20112 notes
#webdevelopment #javascript
Writing Forward-compatible Websites → developer.mozilla.org

You should DEFINITELY read the original article but for a quick shot you can check my notes from the article:

  • Add “window.” as a prefix to your event handler function calls or global variables like this:
    Ex.
    <div onclick=”window.localName()”> to prevent name collisions…
  • When you plan to use a feature use object-detection to sniff for that exact feature (if possible). Do not assume presence/absense of one feature implies presence/absense of another feature…
  • Test your code at least in Firefox, Chrome or Safari, Opera and IE.
  • When using a new feature (even standard ones) that is not universally implemented, make sure to test in a browser that doesn’t implement it to see its behavior.
  • If you want to user vendor prefixed CSS features add the unprefixed version of the feature to the end of list iff this unprefixed version is implemented at least one of the browsers.
    Ex. 
    .pretty-element {
      -vnd-make-it-pretty: sometimes;
      make-it-pretty: sometimes;
    }
  • Pass a validator to ensure all your “>” characters are present… Otherwise your code in browsers with HTML5 support can lead to unexpected situations.
  • If you try using a CSS property to do something you want, but it has no effect, remove it.  It might start doing something you don’t expect in the future.
Nov 23, 20111 note
#webdevelopment #webdesign #html5 #css3
Develop Native Mobile Applications Using Web Technologies

If you are a web developer who wants his/her web applications run on mobile devices like native applications, you probably know appMobi and PhoneGap platforms already.. But I still want to mention them :)

appMobi

appMobi opens the world of mobile app development to you with an easy-to-use development tool called the XDK (which stands for Cross Platform Development Kit). Unlike native app development tools, the XDK uses standard web languages (HTML5, CSS, and JavaScript) to create mobile apps for smartphones and tablets. You can develop and test apps using Macintosh, PC, DreamWeaver, Visual Studio - whatever tools you are already comfortable using.

It requires Java6, Chrome, a google account (for android apps) 

Good news, they say “It is completely free to download and try”

PhoneGap

PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores. PhoneGap leverages web technologies such as HTML and JavaScript.

The downside of using PhoneGap has been that developers still had to set up native SDK-based development environments and you had to develop your own web view containers for each platform you wish to support. That is, if you want your application to run on IOS devices like iphone, ipad it requires Intel-based computer with Mac OS X Snow Leopard. Meanwhile, for Android devices there are no environment restrictions.

PhoneGap XDK

With PhoneGap XDK, you will no longer need to buy and set up any of the desktop SDK tools (machines, sdks, etc.) to create native apps. If you have a favorite IDE, you can use it, or you can use the XDK’s built in editor. Multi-device simulation and debugging are all integrated, even including local and remote on-device testing. It is like the Linux :) of the PhoneGap as it is stated in the appMobi’s web site…

It is free and requires Java6 and Chrome…

By the way appMobi earns money from their “Cloud App Services“ 

Nov 23, 201111 notes
#webdevelopment #mobile #html5 #cloud #iphone #android
DHTMLX Touch → dhtmlx.com

DHTMLX Touch is a free JavaScript mobile framework for building HTML5-based web apps for mobile and touch devices as stated in their web page. 

  • It includes an online skin builder for skin customizations. (Of course, you can modify the CSS anytime…)
  • It can be integrated into most of the main IDEs providing autocomplete feature…
  • It has an acceptable range of supported platforms (Chrome,Safari,FF,IE8+,Opera…). Also desktop browser can run the apps…
  • Also there is the Online Visual Designer Tool that you should take a look!

I haven’t used it but after using jQuery Mobile I must say that these HTML5-based web apps are the future and these frameworks makes it enjoyable…

Thanks to:@umutm

Nov 22, 20113 notes
#webdevelopment #mobile #javascript #html5
Codrops - Nice Web Design Blog → tympanus.net

I liked this blog a lot… You can find very usefull information when you dig into it…

Nov 18, 20111 note
#webdesign #webdevelopment #blog
Animated Buttons with CSS3 → tympanus.net

Very stylish and well described animated CSS3 button development tutorial. 

References: 
http://decodering.com/
http://tyb.tumblr.com/

Nov 18, 20111 note
#css3 #html5 #webdesign #webdevelopment

October 2011

3 posts

Webfaction - Web Hosting → webfaction.com

Webfaction is recommended by some of the people I follow.. I haven’t used it yet but it seems reasonable…

Oct 6, 20111 note
#webdevelopment #hosting
Next page →
2012 2013
  • January 1
  • February 1
  • March
  • April
  • May
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012 2013
  • January
  • February 1
  • March 2
  • April
  • May 1
  • June
  • July
  • August
  • September
  • October
  • November
  • December
2011 2012
  • January
  • February
  • March 23
  • April 32
  • May 38
  • June 42
  • July 1
  • August 12
  • September 6
  • October 3
  • November 10
  • December 3