Skip to content

Instantly share code, notes, and snippets.

@lengarvey
lengarvey / web_applications.md
Created Apr 8, 2014
Intro to Web Applications and Rails
View web_applications.md

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 Dec 9, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

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 Nov 11, 2010
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
View move_to_rds.rb
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'