Skip to content

Instantly share code, notes, and snippets.

View wvwatson's full-sized avatar

wwatson wvwatson

View GitHub Profile
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Server Software: Goliath
Server Hostname: localhost
Server Port: 5000

Riak 2.0 Build Instructions with real SOLR searching

These instructions currently target a source build from http://github.com/basho/riak on Ubuntu 12.04 LTS

The configuration shows how to enable the new searching and such.

Prereqs

sudo dpkg --purge nano
sudo apt-get -y install software-properties-common python-software-properties
sudo add-apt-repository -y ppa:nviennot/tmate
sudo add-apt-repository -y ppa:pi-rho/dev # tmux 1.8
sudo add-apt-repository -y ppa:keithw/mosh
sudo apt-get update
sudo apt-get install -y build-essential checkinstall
sudo apt-get install -y vim unzip git ctags pwgen tmate tmux mosh
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
@recipients = "someone@somewhere.com"
@from = "must_be_same_as_smpt_account_login@gmail.com"
@subject = "test from the Rails Console"
@body = "This is a test email"
end
end

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

// For the lack of a nail,
throw new HorseshoeNailNotFoundException("no nails!");
// For the lack of a horseshoe,
EquestrianDoctor.getLocalInstance().getHorseDispatcher().shoot();
// For the lack of a horse,
RidersGuild.getRiderNotificationSubscriberList().getBroadcaster().run(
new BroadcastMessage(StableFactory.getNullHorseInstance()));
@wvwatson
wvwatson / gist:0411d52a69f03546f712b47596dd5ca4
Last active August 17, 2017 21:22
Elixir/Phoenix/Ruby/Rails Training Ubuntu Install Instructions

Install tmux

apt-get tmux

Install nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

Install node 6.0 (at least)