Very Simple Line Graph With D3

I’ve been learning more about D3 and decided to apply what I learned about composition to make a very simple line graph. I’ll just post the pen and comment on it below: See the Pen Very Simple Line Graph with D3 by Mike Newell (@newshorts) on CodePen. Basically, the important parts are that I’m using a factory to create “LineGraph()”.

Composing ‘Chainable’ Functions

Mattias Petter Johansson has a great video explaining the difference between composition and inheritance chains in development. I won’t repeat the tutorial he gives in the video because frankly, his video is better than anything I could write. But! I want to add a tweak to his factory function in order to make your factories “chainable”. Basically so you can call something like

Don’t know why…

But I was inspired by this post: https://marvelapp.github.io/devices.css/ So I made a css iPhone:   See the Pen Pure CSS iPhone by Mike Newell (@newshorts) on CodePen.

Smart Serialization of JSON

Just wanted to point this one out with Chrome moving dom attributes to the prototype chain. If you’re used to stringifying dom objects for requests either to local/remote storage. You might be doing something like this alot: [pastacode lang=”javascript” message=”” highlight=”” provider=”manual”] JSON.stringify(object) [/pastacode] But what you’ll find with chrome 43+ is that the properties in prototype chain don’t get serialized. This

SVN 101

Let’s start with the basics. I’m assuming you know what svn is and the purpose for it. If not, use Google. This tutorial is to get you going with it. I’m assuming you have it installed and are working on a mac. UPDATE: There’s an easier way to structure your project (sorry, I’m learning as I go here…) Pretty simple,

Cordova Getting Started

Once you have it installed. Run the following: [pastacode lang=”bash” message=”” highlight=”” provider=”manual”] cordova create hello com.example.hello HelloWorld cordova platform add ios cordova build [/pastacode] Open your project in Xcode (under the platforms folder/ios) and you should be able to run it on an ios device!

Git Untrack and Retrack

If you want to untrack an accidentally committed file, then retrack it later: [pastacode lang=”bash” message=”” highlight=”” provider=”manual”] git update-index –assume-unchanged path/to/file [/pastacode] To untrack it and: [pastacode lang=”bash” message=”” highlight=”” provider=”manual”] git update-index –no-assume-unchanged path/to/file [/pastacode] to retrack it later! From here: http://stackoverflow.com/questions/6964297/untrack-files-from-git

How To Build GearVR Apps with Unity

  Great step by step instructions for setting up your environment correctly here: https://www.reddit.com/r/GearVR/comments/2qcryc/step_by_step_guide_to_building_apps_for_the_gear/ Oculus Signature File: Get your device id by: [pastacode lang=”bash” message=”” highlight=”” provider=”manual”] adb devices [/pastacode] Copy the id and paste it on the site below to get your signature file Oculus signature file: https://developer.oculus.com/osig/ Oculus Android Utility Package: Download the oculus utilities package: https://developer.oculus.com/downloads/game-engines/0.1.0-beta/Oculus_Utilities_for_Unity_5/ Made a quick

Arguments has a length, Object Literals do not?

I’m going to research on this and get back here. Basically, I’m wondering the following: Why am I able to test inside of a function for arguments.length. But I can create an object literal and length is undefined? example: [pastacode lang=”javascript” message=”” highlight=”” provider=”manual”] function count(a,b) { console.log(arguments.length); // 2 } count(1,2); var obj = { a: 1, b :

Guaranteed Instantiation in Javascript

quick one today. Let’s say you like the constructor pattern for objects. You probably do something similar to this: [pastacode lang=”javascript” message=”” highlight=”” provider=”manual”] function Person(name) { var __ = this; __.name = name; return __; } [/pastacode] Let’s say you forget to use the”new” operator to instantiate the function and instead just call it as is while trying to