Zoom
Trash
PDoc. Encode latitude and longitude in a string format that is friendly to text-based searching. WordPress functions.php Snippets | WP FUNCTION ME. Sinatra. Vesln/jack - GitHub. Satyr/coco - GitHub. Chernikovalexey/Kumquat - GitHub. Web-Drawing Throwdown: Paper.js Vs. Processing.js Vs. Raphael. Advertisement Before drawing anything in a browser, ask yourself three questions: Do you need to support older browsers? If the answer is yes, then your only choice is Raphaël. It handles browsers all the way back to IE 7 and Firefox 3. Raphaël even has some support for IE 6, although some of its underlying technology cannot be implemented there.Do you need to support Android? Paper.js, Processing.js and Raphaël are the leading libraries for drawing on the Web right now. Choosing the right framework will determine the success of your project.
All of the code in this article is open source and can be run on the demo page that accompanies this article. Overview It’s all JavaScript once the page runs, but the frameworks take different paths to get there. PaperScript is a JavaScript extension that makes it possible to write scripts that don’t pollute the global namespace. Processing.js is based on a framework named Processing, which runs in the Java Virtual Machine. Getting Started Paper.js: (al) Open Geocoder.
A Beginner's Guide to Using the Application Cache. Introduction It's becoming increasingly important for web-based applications to be accessible offline. Yes, all browsers can cache pages and resources for long periods if told to do so, but the browser can kick individual items out of the cache at any point to make room for other things. HTML5 addresses some of the annoyances of being offline with the ApplicationCache interface.
Using the cache interface gives your application three advantages: Offline browsing - users can navigate your full site when they're offline Speed - resources come straight from disk, no trip to the network. The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users. The cache manifest file The cache manifest file is a simple text file that lists the resources the browser should cache for offline access. Referencing a manifest file To enable the application cache for an app, include the manifest attribute on the document's html tag: WebDev | Development/Etc. Libraries/Toolkits/Frameworks/Etc | Development/Etc.
Cloudnode: Node.JS Hosting. Deft | Open Source Web Server. Varnish | Web Application Accelerator. Google Cloud Storage - Introduction. Products | Amazon Web Services. Amazon Web Services offers a broad set of global compute, storage, database, analytics, application, and deployment services that help organizations move faster, lower IT costs, and scale applications. These services are trusted by the largest enterprises and the hottest start-ups to power a wide variety of workloads including: web and mobile applications, data processing and warehousing, storage, archive, and many others. Amazon Web Services provides a variety of cloud-based computing services including a wide selection of compute instances which can scale up and down automatically to meet the needs of your application, a managed load balancing service as well as fully managed desktops in the cloud. Sign up with Amazon Web Services and receive 12 months of access to the AWS Free Usage Tier and enjoy AWS Basic Support features including, 24x7x365 customer service, support forums, and more.
Amazon EC2 provides resizable compute capacity in the cloud. Learn more » See pricing details » Markdown Syntax Documentation. Note: This document is itself written using Markdown; you can see the source for it by adding ‘.text’ to the URL. Overview Philosophy Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. To this end, Markdown’s syntax is comprised entirely of punctuation characters, which punctuation characters have been carefully chosen so as to look like what they mean. Inline HTML Markdown’s syntax is intended for one purpose: to be used as a format for writing for the web. Markdown is not a replacement for HTML, or even close to it. For any markup that is not covered by Markdown’s syntax, you simply use HTML itself.
The only restrictions are that block-level HTML elements — e.g. For example, to add an HTML table to a Markdown article: This is a regular paragraph. Note that Markdown formatting syntax is not processed within block-level HTML tags. Span-level HTML tags — e.g. Automatic Escaping for Special Characters © 4 < 5 1. Javascript Best Practices. Introduction This document is a list of best practices and preferred ways of developing javascript code, based on opinions and experience from many developers in the javascript community. Since this is a list of recommendations rather than a list of absolute rules, experienced developers may have slightly differing opinions from those expressed below. Always Use 'var' Variables in javascript either have global scope or function scope, and using the 'var' keyword is vital to keeping them straight. When declaring a variable for use either as a global variable or as a function-level variable, always prefix the declaration with the 'var' keyword.
The example below highlights the potential problem caused by not doing so. Problem Caused By Not Using Var var i=0; // This is good - creates a global variable function test() { for (i=0; i<10; i++) { alert("Hello World! ") Fixed Function function test() { var i=0; for (i=0; i<10; i++) { alert("Hello World! ") Feature-Detect Rather Than Browser-Detect. When can I use... Support tables for HTML5, CSS3, etc. Pygments — Python syntax highlighter. JavaScript: Warts and workarounds. When warts collide: var versus with Lexical block scope in JavaScript is broken, and though the use of with is generally considered poor form, it's a good solution to this problem.
In most curly-braced languages, blocks delineate lexical scope. For example, in C or Java: { int i = 13 ; { int i = 42 ; print(i) ; } print(i) ; } this code prints 42 and then 13. But, in JavaScript: { var i = 13 ; { var i = 42 ; console.log(i) ; } console.log(i) ; } this code prints 42 and 42. In JavaScript, only functions introduce a new lexical scope and variable declarations are implicitly hoisted to this level. For instance: function f () { var i = 13 ; { var i = 42 ; print(i); } print(i) ; } Is equivalent to: function f () { var i ; i = 13 ; { i = 42 ; print(i) ; } print(i) ; } Aside: Hoisting under the hood JavaScript takes hoisting to extremes. The following program -- a lone reference to x -- provokes a reference error: x ; // ReferenceError: x is undefined but the following program is OK because var x gets hoisted: Two Game Changing CSS 3 Features - CodeBrief. HTML and CSS has always been filled with frustration when it comes to being able to intuitively create layouts and designs.
Web developers have long since sacrificed ease of implementation for accessibility and semantic purity. Basic layouts and simple aesthetics frequently require very non-trivial implementations. This is especially apparent to developers who have tasted the forbidden fruit of other platforms such as Flex, Android, et al. Until the near future. Two CSS 3 features in particular are finally solving this in a major way, making web design palatable to the code minimalist in all of us.
Flexible Box Layouts The CSS 3 spec has introduced a new module which is supported by all major non-IE browsers as well as the IE 10 preview. Gone are the days of forcing a layout into a float-based implementation. Anyone coming from a Flex or Android background will immediately see the value of this. For example, consider the following layout: Child One Child Two Child Three Child Four.
Pagedown - A JavaScript Markdown converter and editor. MultiMarkdown. “As the world goes multi-platform with all of the new mobile operating systems, MultiMarkdown provides an easy way to share formatting between all of my devices. It’s easy to learn (even for us mortals) and immediately useful.” — David Sparks, MacSparky.com “Personally, it’s changed my game — it’s how I think now.
Can’t imagine writing more than a paragraph in anything that doesn’t do MMD.” — Merlin Mann, kung fu grippe What is MultiMarkdown? MultiMarkdown, or MMD, is a tool to help turn minimally marked-up plain text into well formatted documents, including HTML, PDF (by way of LaTeX), OPML, or OpenDocument (specifically, Flat OpenDocument or ‘.fodt’, which can in turn be converted into RTF, Microsoft Word, or virtually any other word-processing format). MMD is a superset of the Markdown syntax, originally created by John Gruber. MultiMarkdown started as a Perl script, which was modified from the original Markdown.pl. MultiMarkdown v4 is basically a complete rewrite of v3. You simply write: Web development tutorials, from beginner to advanced. Using jQuery, Plugins and UI Controls With Backbone. Most Backbone applications either use jQuery or Zepto as their DOM manipulation of choice. I tend to use jQuery as it’s supported across more browsers and has more features – though it is a little heavier in terms of download size (and maybe performance).
I also use a lot of jQuery plugins for various controls, to create specific effects, etc. It’s generally easy to do, as Backbone’s views provide direct access to a jQuery element as “this.el” or “this. $el”. From there, we can call standard jQuery code and plugins. There are some common patterns I’ve noticed for doing this, too. Specifically, when to call a particular jQuery function or plugin largely depends on the purpose of that function and sometimes depends on how that function or plugin is built.
DOM Dependent/Independent At a very basic level, jQuery manipulations of the DOM can fall in to 1 of 2 categories: DOM-dependent and DOM-independent. Of course, this is a great oversimplification of things. Simple Manipulations And Events.
HTML5SQL.JS. Robertpiira/ingrid - GitHub. d3.js. Svg circle example. SVG Circle. Basic Shapes – SVG 1.1 (Second Edition) Contents 9.1 Introduction SVG contains the following set of basic shape elements: rectangles (including optional rounded corners), created with the ‘rect’ element,circles, created with the ‘circle’ element,ellipses, created with the ‘ellipse’ element,straight lines, created with the ‘line’ element,polylines, created with the ‘polyline’ element, andpolygons, created with the ‘polygon’ element.
Mathematically, these shape elements are equivalent to a ‘path’ element that would construct the same shape. 9.2 The ‘rect’ element The ‘rect’ element defines a rectangle which is axis-aligned with the current user coordinate system. ‘rect’ Categories: Basic shape element, graphics element, shape element Content model: Any number of the following elements, in any order: Attributes: DOM Interfaces: SVGRectElement Attribute definitions: x = "<coordinate>" The x-axis coordinate of the side of the rectangle which has the smaller x-axis coordinate value in the current user coordinate system. Y = "<coordinate>" <? <? <? Your source of Javascript :: Free Weekly Javascript newsletter. Microjs: Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit!
Build Management for Javascript, Coffescript and Friends - Paracode. Update, 16-feb: I’ve added Brewer.js to the review. tl;dr Find a tool that can compile coffeescript, take javascripts and vendor javascript libs, join them preserving order, and minify them into one file good for release. If that tool can do CSS/stylus/sass all the better. I pick sprockets eventually and show how you can tailor it to your needs. Its also been quite a journey and I’ve not to make it tiresome and include all of the details. Custom made concoctions This is the quickest way you can have at setting up a build for your code, and sometimes it is just enough.
To do this, you can use plain cat and minify command line libraries with a Makefile, use closure compiler with ruby, or use uglifyjs with node Cakefiles. Dedicated tooling First some words about CommonJS and its module system. Stitch With it, you can use CommonJS in your browser. Hem Quite a new tool, looks like hem was built to provide great build experience for Spine.JS. Sprockets The familiar pipeline from Rails. Brewer.js. Weepy/o_O - GitHub. Bare domain name (no-www) | FAQ - NearlyFreeSpeech.NET. By default, this is the correct behavior. Using URLs of the form creates a number of problems, and we strongly recommend that you avoid it. Some of the limitations are: It creates noncanonical URLs for your site. It is highly desirable to have one URL for each page, for purposes of bookmarking, etc. Having multiple valid URLs for the same page makes your site look less popular, both in rankings and search engines.
Although we don't recommend the practice, you are still welcome to use bare domains with our service. We strongly encourage you to consider the alternatives and implications before using the bare domain name. You can add the example.com alias to your site and enable hard canonical type setting.If you have NearlyFreeSpeech.NET DNS and are using your domain with a site hosted here, you can enable this option by selecting the "Add Bare Domain Forward" action on the DNS information page for your domain in our member UI.
How A Missing Favicon Broke My App for Chrome Users. Excuse me while I let off some steam. I’ve just spent many hours debugging an authentication issue that was preventing Google Chrome users from logging into a PHP web app we’re currently working on. Here are the gory details for your amusement. The app uses OAuth to authenticate against the client’s central auth service. That means instead of logging in to our app directly, the process is more like signing into Twitter from a third party – we send the user away to log in, they authenticate on the central server as normal and get sent back to us with a token which we can then use to log them in to our app. The issue we were seeing is that Chrome users were clicking the login link, being sent out to authenticate, coming back and still being told they weren’t logged in.
In all other browsers, returning from a successful login allowed access the app as expected. Usually, if sessions go awry, the best thing to do is turn to the raw HTTP headers.