Skip to content

Instantly share code, notes, and snippets.

@lengarvey
lengarvey / web_applications.md
Created April 8, 2014 20:20
Intro to Web Applications and Rails

So you want to build a web site?

Here's how the web works:

  1. A user types a web address (or clicks a link) into their browser.
  2. The browser asks a server for the page corresponding to that web address.
  3. The server responds with data, generally text encoded as HTML.
  4. The browser displays this HTML to the user.

To build a web application we don't need to worry about the browser (someone else has built that) so we just need to concern ourselves with instructing the server what to respond with. All of Ruby on Rails is concerned with step 3.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'