Node.js is just JavaScript running on the server side. That's it. That's all there is to it.
- Express Docs, if you want to get started and already know JavaScript this is the place to be
#!/usr/bin/env ruby | |
def find_deps(cookbook_dir) | |
nel = Hash.new { |h, k| h[k] = [] } | |
Dir.glob("#{cookbook_dir}/*/").each do |r| | |
deps_for(r, nel) | |
end | |
nel | |
end |
include_recipe "aws" | |
include_recipe "lvm" | |
include_recipe "xfs" | |
esvg = node.elasticsearch.ebs.lvm.volume_group | |
eslv = node.elasticsearch.ebs.lvm.logical_volume | |
Chef::Log.info "ElasticSearch: setting up 8 100G EBS volumes" | |
aws = data_bag_item("aws", node.app_environment) | |
8.times do |d| | |
disk = (d == 0 ? "/dev/sdi" : "/dev/sdi#{d}") |
> ab -n 10000 -c 100 http://127.0.0.1:8080/ | |
This is ApacheBench, Version 2.3 <$Revision: 1139530 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 1000 requests | |
Completed 2000 requests | |
Completed 3000 requests | |
Completed 4000 requests |
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
Node.js is just JavaScript running on the server side. That's it. That's all there is to it.
var cluster = require('cluster'); | |
var PORT = +process.env.PORT || 1337; | |
if (cluster.isMaster) { | |
// In real life, you'd probably use more than just 2 workers, | |
// and perhaps not put the master and worker in the same file. | |
cluster.fork(); | |
cluster.fork(); | |
cluster.on('disconnect', function(worker) { |
#!/bin/sh | |
# INSTALL | |
wget -O- http://hydra.nixos.org/build/4253979/download/1/nix-1.5.1-x86_64-linux.tar.bz2 \ | |
| tar xj -C / | |
sudo -i nix-finish-install | |
# DEFAULT PROFILE | |
ln -sf /nix/var/nix/profiles/default/etc/profile.d/nix.sh \ | |
/etc/profile.d/nix.sh |
For mass destruction (j/k I mean powerful data gathering)
Install Boto
Install GNU Parallel
# Activate the gem you are reporting the issue against. | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do |