git add -p <filename>
git remote add upstream <upstream git url>
##Undo a commit
from django.template import loader, Context | |
from django.utils.safestring import mark_safe | |
class MyWidget(forms.RadioSelect.renderer): | |
def render(self): | |
'''Outputs radios''' | |
t = loader.get_template('my_widget.html') | |
c = Context({"radios": self, | |
"name": self.name}) | |
return mark_safe(t.render(c)) |
Person | Present |
---|---|
io | sono |
tu | sei |
lui/lei | è |
noi | siamo |
voi | siete |
loro | sono |
goog.provide('events_tutorial.ColoredSprite'); | |
goog.require('lime.Sprite'); | |
goog.require('lime.animation.ColorTo'); | |
goog.require('events_tutorial.Events'); | |
events_tutorial.ColoredSprite = function(width, height) { | |
goog.base(this); |
goog.provide('events_tutorial'); | |
goog.require('lime.Director'); | |
goog.require('lime.Scene'); | |
goog.require('lime.Layer'); | |
goog.require('lime.Label'); | |
goog.require('lime.animation.FadeTo'); | |
goog.require('lime.animation.Spawn'); | |
goog.require('lime.animation.ScaleTo'); |
goog.provide('events_tutorial.Events'); | |
goog.require('goog.events.Event'); | |
goog.require('goog.events.EventTarget'); | |
events_tutorial.Events = new goog.events.EventTarget(); | |
events_tutorial.Events.ChangeColorEvent = function() { | |
goog.events.Event.call(this, 'CHANGECOLOR'); | |
}; |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
window.CocoonJS_ENV = true; | |
window.onload = function() | |
{ | |
// Create a canvas and draw something in it. |
type LinkedList struct { | |
head *node | |
} | |
func (ll *LinkedList) AddToHead(data int) { | |
ll.head = &node{data: data, next: ll.head} | |
} |
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
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