- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Lockfile behaviour implemented via Unix PID files. | |
""" | |
from __future__ import absolute_import | |
import os | |
import sys | |
import errno | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2010-2012 Vinay Sajip. All rights reserved. Licensed under the new BSD license. | |
# | |
import ctypes | |
import logging | |
import os | |
class ColorizingStreamHandler(logging.StreamHandler): | |
# color names to indices | |
color_map = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Python logging tuned to extreme. | |
""" | |
__author__ = "Mikko Ohtamaa <mikko@opensourcehacker.com>" | |
__license__ = "MIT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log_file = open('example.log', 'a') | |
logging.basicConfig(stream=log_file, level=logging.DEBUG) | |
logging.debug("Test") | |
sys.stdout = log_file | |
sys.stderr = log_file | |
stdout_fd = os.dup(1) | |
stderr_fd = os.dup(2) | |
os.dup2(log_file.fileno(), 1) | |
os.dup2(log_file.fileno(), 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
class LoggerWriter: | |
def __init__(self, logger, level): | |
self.logger = logger | |
self.level = level | |
def write(self, message): | |
if message != '\n': | |
self.logger.log(self.level, message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tee(object): | |
def __init__(self, name, mode): | |
self.file = open(name, mode) | |
self.stdout = sys.stdout | |
sys.stdout = self | |
def __del__(self): | |
sys.stdout = self.stdout | |
self.file.close() | |
def write(self, data): | |
self.file.write(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
class RedirectStdStreams(object): | |
def __init__(self, stdout=None, stderr=None): | |
self._stdout = stdout or sys.stdout | |
self._stderr = stderr or sys.stderr | |
def __enter__(self): | |
self.old_stdout, self.old_stderr = sys.stdout, sys.stderr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def redirect_stderr_stdout(stderr=sys.stderr, stdout=sys.stdout): | |
def wrap(f): | |
def newf(*args, **kwargs): | |
old_stderr, old_stdout = sys.stderr, sys.stdout | |
sys.stderr = stderr | |
sys.stdout = stdout | |
try: | |
return f(*args, **kwargs) |
OlderNewer