Posts Tagged ‘javascript’

Javascript: Simple cookie managing

Just a code snippet to manage cookies in a simple way:

function cookie(name,value,expire) {
	var D = document,d,r,c,n,f;
	if (void 0 != value) {
		d = new Date;
		d.setDate(d.getDate()+expire);
		D.cookie = name + "=" + escape(value) + ((null==expire) ? "" : ";expires=" + d.toGMTString());
	} else {
		r = [], c = D.cookie.split(";");
		for (n = 0; n < c.length; n++) (f = c[n].match(RegExp("^\\s*"+name+"=\\s*(.*?)\\s*$"))) && r.push(f[1]);
		return r[0]?r[0]:!1;
	}
}

You can set, read or delete cookie:

cookie(name,val);
cookie(name);
cookie(name,'',-1);

GitHub gist available here.

Parallax.js

Parralax.js – Simple, lightweight parallax engine that reacts to the orientation of a smart device.

parallax.js

Besides mouse/cursor support, it works on mobile and tablet (where gyroscope or motion detection hardware is available) too.
It comes with multiple options for customizing the effect where they can be set inline using “data attributes” or in JavaScript.

Parallax.js reacts to the orientation of your smart device, offsetting layers depending on their depth within a scene… Oh, you don’t have a smart device? No worries, if no gyroscope or motion detection hardware is available, parallax.js uses the position of your cursor instead. Radical.

Adobe Brackets – A New HTML/CSS/JavaScript Open-Source IDE

Brackets is an open-source editor for web design and development built on top of web technologies such as HTML, CSS and JavaScript. The project was created and is maintained by Adobe, and is released under an MIT License.

Among the most interesting aspects to this new IDE project is that:

Brackets is still in the oven and needs to bake a little longer before it’s a full-featured code editor. The milestone builds available on GitHub are there for contributors and those special kind of crazy designers and developers who like to live on the edge. Performance, stability and features are all in flux. Use at your own risk.
However, if you like living on the bleeding edge, just view the wiki for info on how to download and run Brackets.

Fork it on GitHub!

jQuery 1.7.2 Released

jQuery 1.7.2 is looking good! The release candidate went smoothly so we’ve made only one small change and are releasing it to your eager hands today. You can get the oven-fresh code from the jQuery CDN now

jQuery blog post and changelog

Stylish for Safari: Major version Update – 1.3

New version of my useful extension available for download!

v.1.3 Changelog:

InstaTab – Instagram application for Facebook Pages.

Hi hipsters! I have a brand new application for all of you “Instagram Tab“!.
Visit this landing page to install app on your page.

Application based on Instagram and Facebook APIs, PHP, MySQL and jQuery.

Like and share, thank you!

Cross Browser Support for Console.log()

Almost all programmers use browsers Javascript-console for debugging.
The console is built into Chrome, Opera, IE and installed with Firebug in Firefox.
But she has a couple of disadvantages, which can be very easy to fix.

console.log('Cross Browser Support!');

They are:

Lets fix these problems quickly and easily!
(more…)