I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis
onto
the box and here's how I did it and some things to look
out for.
To install:
function getFriends( userId, people ){ | |
var user, friendList, friendsIdList, friendsList = null; | |
function checkUser( id ){ | |
return people[id] | |
} | |
function findPeople( id ){ | |
var foundPerson; | |
people.forEach( function ( person ){ |
Напишите конструктор $, который принимает аргументом DOM селектор. | |
Реализуйте методы width, height которые соответсвенно изменяют ширишу и высоту всех селекторов, | |
которые мы определили ранее. | |
Пример: | |
var $div = $('div') | |
console.log( $div ) //показать все div на странице. | |
var $red = $('.red') |
The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).
In a nutshell,
So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
MongoDB upstart scripts for Ubuntu. | |
Run following commands after installing upstart scripts: | |
ln -s /lib/init/upstart-job /etc/init.d/mongoconf | |
ln -s /lib/init/upstart-job /etc/init.d/mongodb | |
ln -s /lib/init/upstart-job /etc/init.d/mongos | |
To start services use: |
var flag = false | |
setTimeout(function(){ | |
console.log('settimeout main') | |
}, 10000) | |
setTimeout(function(){ | |
flag = true | |
}, 100) |
[1, true, false, 0, 0, null] | |
.filter(Boolean) | |
.map(function(value) { | |
return { | |
status: new Boolean(value), | |
date: new Date() | |
} | |
}) | |
.forEach(function(obj) { | |
VendorsItems.insert(obj) |
#!/bin/sh | |
PASS=true | |
echo "\nElsint Javascript:\n" | |
npm run eslint | |
if [[ "$?" == 0 ]]; then | |
echo "\t\033[32mESLint Passed: $FILE\033[0m" | |
else |
#!/usr/bin/env bash | |
# | |
# Copyright (c) 2010-2014, Benjamin C. Meyer <ben@meyerhome.net> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# 1. Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright |