soderlind.no

I code for fun

4.3.2010
by PerS
0 comments

When .LESS is more

@the-border: 1px;
@base-color: #111;

#header {
	color: @base-color * 3;
	border-left: @the-border;
	border-right: @the-border * 2;
}

#footer {
	color: (@base-color + #111) * 1.5;
}

ul
{
	list-style-type: none;
	height: 30px;

	li
	{
		float: left;
		padding-right: 15px;

		a
		{
			padding: 5px;
			display: block;
			color: black;
			text-decoration: none;
		}

		a:hover
		{
			background-color: @menu_color - #222;
		}
	}
}

Curious? 4GuysFromRolla has a nice article about .LESS

btw, if you’re not doing ASP.NET, you can create css from .less by using the command line compiler:

dotless.Compiler.exe -m Styles.less Styles.css

25.2.2010
by PerS
1 Comment

jQuery 101: Adding unobtrusive ajax to your existing form page

Using jQuery and the form and validate plugins, it is simple to add  unobtrusive ajax to your existing form page

1, Modify your existing form page

  1. Add <input type="hidden" name="isAjax" id="isAjax" value="0" /> to your form. This field will tell the processing script, process_input.php in my example, if the values in the form were submitted using ajax or as an ordinary form submit, defaulting to isAjax = 0 (false).
  2. Add class="required" to the fields that requires input
  3. Add the <div id="result"></div> where you want the ajax output
<form id="form1" name="form1" method="post" action="process_input.php">
	<input type="hidden" name="isAjax" id="isAjax" value="0" />
	Name: <input type="text" name="name" class="required" id="name" value="" /> <br />
	<input type="submit" name="submit" id="submit" value="submit" />
</form>
<div id="result"></div>

Continue Reading

10.2.2010
by PerS
1 Comment

Fighting spam

I have reduced the number of  splog attacks on my site

I use the Akismet and WP-DenyHost anti-spam plugins for WordPress. Akismet is a must-have and has, since I installed it, caught 304,056 spams (!!).  When Akismet catch a spammer, it logs the spammers IP address. WP-DenyHost, written by me, prevents spammers from getting access to my site a second time by blocking access from this IP address.

I installed WP-DenyHost in the fall 2009 and, as you can see from the graph above, the number of spam has dropped dramatically.

.

15.1.2010
by PerS
0 comments

jQuery 1.4 Released

*DRUM ROLL*  jQuery 1.4 is released !!!

It has a lot of new features and enhancements like the examples below:

jQuery("<div>", {
    "class": "test",
    text: "Click me!",
    click: function(){
        $(this).toggleClass("test");
    }
}).appendTo("body");

jQuery("<input>", {
    type: "text",
    val: "Test",
    focusin: function() {
        $(this).addClass("active");
    },
    focusout: function() {
        $(this).removeClass("active");
    }
}).appendTo("form");

18.12.2009
by PerS
1 Comment

Bergensbanen, a 7 hours train ride in HD released under Creative Commons

UPDATE: The 1080i 50P ProRes file is available as a torrent (NOTE, it’s a 246GB file !)

Friday November 27th over 1,4 million Norwegians watched parts of “Bergensbanen” on NRK2. The longest documentary ever? At least the longest we have made, almost 7 1/2 hours, showing every minute of the scenic train ride between Bergen on the Norwegian west coast, crossing the mountains to the capital of Oslo.
.. source: http://nrkbeta.no/2009/12/18/bergensbanen-eng/

To wet your appetite, here’s a 10 minute video, from Finse:

[youtube]http://www.youtube.com/watch?v=Ql2qXpNVTjw[/youtube]

Facts:

  • 7 hours continues front view recording.
  • Recorded on a Sony 700 camera in XDCAM HD 1080 50i.
  • Available as 720 50P, 1280×720 version, 22 GB file, and as a 1080i 50P ProRes file (NOTE, it’s a 246GB file !)
  • Released under Creative Commons

Trivia:

For more information, and the download, head over to http://nrkbeta.no/2009/12/18/bergensbanen-eng/

13.11.2009
by PerS
0 comments

Free SharePoint

NetConnect recently launched the Team Portal Free Version:

The dashboard

Now you can make use of SharePoint to share information, documents and tasks with others – free of charge. Invite as many members as you like to your Team Portal site.

Key features

  • Hosted SharePoint
  • User friendly dashboard for managing sites, people and resources
  • Create tasks and assign them to other members – track the progress
  • Online document and file sharing with document check-in and check-out for efficient document collaboration
  • Discussion forum
  • Shared team calendar
  • No software installation
  • Limited to 50 MB storage and one SharePoint site per account. Upgrade possible for more storage and more sites

Continue Reading