background preloader

JavaScript

Facebook Twitter

Sortable. No jQuery. Private Members in JavaScript. Douglas Crockford www.crockford.com JavaScript is the world's most misunderstood programming language.

Private Members in JavaScript

Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. But this is a misunderstanding. JavaScript objects can have private members. Here's how. Objects JavaScript is fundamentally about objects. If a value is a function, we can consider it a method. Objects can be produced by constructors, which are functions which initialize objects. Public The members of an object are all public members. In the constructor This technique is usually used to initialize public instance variables.

Function Container(param) { this.member = param; } Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Too… 8 Handy Tips to Consider When Logging in JSON. Logging in JSON transforms your logs from raw text lines to a database of fields you can search, filter, and analyze.

8 Handy Tips to Consider When Logging in JSON

This gives you way more power than you would get with only raw logs. Why Use JSON? JSON makes it easier to search and analyze your data. Say this is a portion of your log file: I want to figure out how many 29 year olds are from San Francisco. With the above approach, you’ll end up with log entries that include any text that has “29” in it, including the date for Fred who is only 21 years old. Log management tools like Loggly can automatically parse and analyze JSON data. Tips for Logging in JSON Here are some tips and choices to consider when implementing logging in JSON. Tip #1: Write New Apps With JSON if you’re writing a new application, write JSON logging into it in the beginning.

Tip #2: Log Both Errors and Behavior When you add a product feature, include enough information to log both errors (especially user-facing errors) and behavior or usage. Gabemart/hipku. Gabemart/hipku · GitHub. LokiJS: Fast In-memory Database. Procedural generation - map/world "decorator" algorithms/patterns. Procedural generation - Algorithm for procedureral 2D map with connected paths. Pojo Viz. Sindresorhus/awesome-nodejs · GitHub. p2.js. Game Mechanic Explorer. MegaTextures in WebGL « Various Oddities. Before diving into the code, I’d like to blather on a bit about what MegaTextures are, why they are so awesome, and how they work — at least, how _I_ think they work, which could be totally wrong – I’ll be prefixing everything with ‘my implementation’ and that way you hopefully won’t think this is the only way to do this -_- Disclaimer: this was written in the middle of the night, so excuse me if it’s kind of scatterbrained.

MegaTextures in WebGL « Various Oddities

It’s kind of a mind dump on megatextures and my implementation, not meant to be a primary reference. Hopefully there are some interesting details in here regardless of what environment you are implementing them in. ‘MegaTexture‘ is a term coined by John Carmack, used in the id Tech 5 engine. They are commonly referred to as ‘Virtual Textures’ or ‘Sparse Virtual Textures’, but I think MegaTextures sounds awesome so that’s what I use. I could make a million diagrams, but I won’t, cause I’m lazy and you can look at their stuff ^_^ Pros/Cons ‘Why do this at all?’ Good: Erlang and JavaScript MD5 Digest match.

Ragdoll Animator. Box2DJS - Physics Engine for JavaScript. Javascript parallel processing. Steep Parallax Shader. Simple C# Web Server. By david1.

Simple C# Web Server

April 2012 17:28 During my lunchbreak the other day I wondered how hard it would be to write a simple webserver in C#. Surely with all the toys in the .net framework these days it should be pretty easy? So I decided to give it a go and see what happens. The aim was to write a simple class that recieves a delegate to a method which is responsible for the page content, everything else could be taken care of by the class I'm writing. It took me about 30 minutes to get it working. All the work is done on background threads, which will be automatically cleaned up when the program quits.

I'm even considering using this code to build a little DALIS aware test server, so that I can run DALIS programs without hosting anything in IIS... even better I could run a couple of them and bounce DALIS programs between them. Parallax Shader for WebGL / ThreeJS.