Posts Tagged ‘javascript’

Instagram images pulled via HTTPS not displaying

Instagram images pulled via HTTPS not displaying.
The source of the problem is AKAMAI.
Their SSL Certificate is reported to be invalid. Thus Chrome/Firefox/Safari does not load images.

To temporarily fix this issue you can use this short code snippet:

var src = '//igcdn-photos-e-a.akamaihd.net/hphotos-ak-prn/'+oldsrc.split('/').pop();

UPD: issue fixed, no need to change the urls 😉

Velocity.js — Accelerated JavaScript animation

Velocity is a jQuery plugin that re-implements $.animate() to produce significantly greater performance (making Velocity also faster than CSS animation libraries) while including new features to improve animation workflow.

Velocity works everywhere — back to IE8 and Android 2.3. Under the hood, Velocity uses jQuery’s $.queue(), and thus interoperates seamlessly with jQuery’s $.animate(), $.fade(), and $.delay(). Since Velocity’s syntax is identical to $.animate()‘s, none of your code needs to change.

Download Velocity, add it to your page, and replace all instances of $.animate() with $.velocity(). You will immediately see a performance boost across all browsers and devices — especially on smartphones.

In just 7Kb, Velocity includes all of $.animate()‘s features while also packing in color animation, transforms, loops, easings, class animation, and scrolling. Velocity is the best of jQuery, jQuery UI, and CSS transitions combined.

Animation demo, starfield demo.

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…)