A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
[assembly: WebActivator.PreApplicationStartMethod(typeof(MyApp.App_Start.NinjectWebCommon), "Start")] | |
[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(MyApp.App_Start.NinjectWebCommon), "Stop")] | |
// please add a reference to NInject.MVC3 | |
namespace MyApp.App_Start | |
{ | |
using System; | |
using System.Web; | |
using System.Web.Mvc; |
(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.
var page = require('webpage').create(), | |
system = require('system'), | |
t, address; | |
if (system.args.length === 1) { | |
console.log('Usage: loadspeedv2.js <some URL>'); | |
phantom.exit(1); | |
} else { | |
t = Date.now(); | |
address = system.args[1]; |
using NodaTime; | |
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
namespace JITterOptimisations | |
{ | |
public static class Extensions |
using Ideafixxxer.Generics; | |
using System; | |
using System.Diagnostics; | |
using System.Text; | |
namespace EnumBenchmarks | |
{ | |
public enum MyEnum | |
{ | |
Undefined = 0, |
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace RegexOptims | |
{ | |
public static class RegexComparer | |
{ | |
private const string REGEX_PATTERN = @"^[\w\d]+$"; |