To get started with Rails we need to install the gem. From the terminal type:
{% terminal %}
$ gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.8.gem (100%)
...
{% endterminal %}
# controller | |
def proc_csv | |
import = Import.find(params[:id]) | |
if import.load_csv | |
flash[:notice] = "woo" | |
redirect_to some_url | |
else | |
flash[:error] = "ohoh" | |
end | |
end |
# The main parse method is mostly borrowed from a tweet by @JEG2 | |
class StrictTsv | |
attr_reader :filepath | |
def initialize(filepath) | |
@filepath = filepath | |
end | |
def parse | |
open(filepath) do |f| | |
headers = f.gets.strip.split("\t") |
require 'socket' | |
NOT_FOUND = "HTTP/1.1 404 Not Found\nContent-Length: 9\n\nNot Found" | |
OK = "HTTP/1.1 200 OK\n" | |
socket = Socket.new(:INET, :STREAM) | |
sockaddr = Socket.sockaddr_in(11080, '127.0.0.1') | |
socket.bind(sockaddr) | |
socket.listen(5) |
<p>SQL: <%= @users.to_sql %></p> | |
<h2>Your first #{search_limit} results</h2> | |
<table> | |
<thead> | |
<th><%= sort_link @search, :id, {}, :method => action_name == 'advanced_search' ? :post : :get %></th> | |
<th><%= sort_link @search, :first_name, {}, :method => action_name == 'advanced_search' ? :post : :get %></th> | |
# ... | |
</thead> |
#!/bin/bash | |
DATE=`date +"%a"` | |
DVOLNAME=datalv | |
LVOLNAME=journallv | |
VOLGR=datavg | |
DVOLPATH=/dev/$VOLGR/$DVOLNAME | |
LVOLPATH=/dev/$VOLGR/$LVOLNAME | |
DSNAME=`echo ${DVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` | |
LSNAME=`echo ${LVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` |
postgres=# \dx | |
List of installed extensions | |
Name | Version | Schema | Description | |
---------+---------+------------+------------------------------ | |
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language | |
(1 row) | |
postgres=# \dx+ | |
Objects in extension "plpgsql" | |
Object Description |
To get started with Rails we need to install the gem. From the terminal type:
{% terminal %}
$ gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.8.gem (100%)
...
{% endterminal %}
JSON
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed. | |
* | |
* If you are unfamiliar with LESS, you can read more about it here: | |
* http://www.lesscss.org | |
*/ |