(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function Template( html, object_s ){ | |
this.html = html, | |
this.object_s = object_s, | |
this.parser = function( obj ){ | |
var html = this.html; | |
for( var i in obj ){ | |
// Create a regex out of object key and replace it with their values | |
var reg = new RegExp( "\{" + i + "\}" , "g" ); | |
var html = html.replace( reg, obj[i] ); | |
} |
function List(){ | |
this.listSize = 0; | |
this.pos = 0; | |
this.data = []; | |
} | |
List.prototype = { | |
toString : function(){ | |
return this.data.toString(); |
{ | |
"name": "Jacob Padilla", | |
"root": true, | |
"children": [ | |
{ | |
"name": "Julian Maxwell", | |
"children": [ | |
{ | |
"name": "Jose Ross", | |
"children": [ |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Orbit Layout Modes</title> | |
<meta charset="utf-8" /> | |
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style> | |
body, html { | |
width: 100%; | |
margin: 0; | |
font-family: "Helvetica Neue", Helvetica, sans-serif; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* | |
InsertionSort(A, n){ | |
for i <- 1 to n-1 | |
value = A[i-1] | |
j = i-1; | |
while( j > -1 & A[j] > value) | |
A[j+1] = A[j] | |
j-- | |
A[j+1] = value |
function LinkedList(){ | |
this.head = null; | |
} | |
LinkedList.prototype.append = function(data){ | |
var newNode = { | |
data : data, | |
next : this.head // Since the new node is going to be the head, assigning existing head reference to next property | |
} | |
this.head = newNode; |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Example of `adapter' design pattern | |
# Copyright (C) 2011 Radek Pazdera | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |