Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things". | |
"1", "Something", "0.50", "2013-05-05 10:00:00" | |
"2", "Another thing", "1.50", "2013-06-05 10:30:00" | |
# Now you want to import it, go to the command line and type: | |
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;" | |
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this: |
CREATE SCHEMA liberated; | |
CREATE OR REPLACE FUNCTION public.liberate() | |
RETURNS boolean | |
LANGUAGE plv8 | |
AS $function$ | |
var tables = plv8.execute( | |
"select relname FROM pg_catalog.pg_class" | |
+ " c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace" |
{ | |
"app/models/*.rb": { | |
"command": "model", | |
"affinity": "model", | |
"alternate": ["unit/models/%s_spec.rb", "spec/models/%s_spec.rb"], | |
"related": "db/schema.rb#%p", | |
"template": "class %S\nend" | |
}, | |
"spec/factories/*_factory.rb": { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
ruby -run -e httpd . -p5000 |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
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) |
#!/bin/bash | |
set -exo pipefail | |
BUILD_ENV=$1 | |
if [ `uname` == 'Darwin' ]; then | |
OSX=1 | |
JSCOMPRESSOR="yuicompressor --type js" | |
else | |
OSX= |
ANTICLOCKWISE OPEN CIRCLE ARROW | |
ANTICLOCKWISE TOP SEMICIRCLE ARROW | |
CLOCKWISE OPEN CIRCLE ARROW | |
CLOCKWISE TOP SEMICIRCLE ARROW | |
DOWNWARDS ARROW | |
DOWNWARDS ARROW FROM BAR | |
DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW | |
DOWNWARDS ARROW WITH CORNER LEFTWARDS | |
DOWNWARDS ARROW WITH DOUBLE STROKE | |
DOWNWARDS ARROW WITH TIP LEFTWARDS |
class Student < ActiveRecord::Base | |
belongs_to :teacher | |
# neighborhood: string | |
end |