issues to work on
goog.require('goog.net.XhrIo'); | |
function get_highscore() { | |
var dataUrl = "http://httpbin.org/get"; | |
goog.net.XhrIo.send(dataUrl, function(e) { | |
var xhr = e.target; | |
var obj = xhr.getResponseJson(); | |
console.log(obj); | |
}); |
// knockout 2.2.1 | |
ko.utils.arrayFilter = function (array, predicate) { /* .. */ } | |
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ } | |
ko.utils.arrayForEach = function (array, action) { /* .. */ } | |
ko.utils.arrayGetDistinctValues = function (array) { /* .. */ } |
# Copyright 2008-2013 Nokia Siemens Networks Oyj | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta property="og:image" content="http://jenniferdewalt.com/images/fb_icon.png"/> | |
<title>Color War | Jennifer Dewalt</title> | |
<link href="css/reset.css" rel="stylesheet"> | |
<link href="css/color_war.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> |
Most Python developers will have this notion that JavaScript sucks and it's horrible. It's really easy to blame the language than to learn the quirks. It's true that JavaScript has it's quirks like Python. Each to their own.
Also, as Python developer we spend most of our time writing server side code. Creating a new Django view, updating a Model or debugging a SQL query. As developers we always believed that we are horrible at frontend prettyness. There might be truth to this statement, but if you believe you can't do something or try to improve you will always stay away from it.
I have seen as a Pythonista that when frontend work is needed, we quickly hack away at cobbling together a few $.ajax
calls with a few $(elem).fadeIn()
without ever thinking of maintainability, readability and abstracting certain functionality into components or modules. With Django we will u
I've always advocated that as a developer, a programming language is just a tool and you should be able to choose the right tool for the right job. Sometimes the circumstances will choose the tool for you. Imagine that time where you need a flat head screw driver and instead used a knife.
For the past five years I've worked with Python and Django. This had the effect of me specializing in Python and being deeply involved in Django. But I've been lucky to be hired as a Software Engineer and I've been working with the MEN
stack which includes MongoDB
,ExpressJS
and Node.js
. Which are all new technologies so I've been learning alot.
This post is to help other developers with a similair background as mine to make the jump from Python
to Node.js
.
Environment
type LinkedList struct { | |
head *node | |
} | |
func (ll *LinkedList) AddToHead(data int) { | |
ll.head = &node{data: data, next: ll.head} | |
} |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
window.CocoonJS_ENV = true; | |
window.onload = function() | |
{ | |
// Create a canvas and draw something in it. |