This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl status postgresql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install postgresql postgresql-contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt install wget curl ca-certificates gnupg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Det måste vara en tom rad här av någon anledning :) | |
sv: | |
date: | |
formats: | |
default: "%Y-%m-%d" | |
short: "%b %d" | |
long: "%B %d, %Y" | |
day_names: [Söndag, Måndag, Tisdag, Onsdag, Torsdag, Fredag, Lördag] | |
abbr_day_names: [Sön, Mån, Tis, Ons, Tors, Fre, Lör] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require "nokogiri" | |
#require "open-uri" | |
class CityImporter | |
attr_reader :wikipedia_cities, :wikipedia_municipalities | |
def import_wikipedia_cities | |
@wikipedia_cities ||= [] | |
wikipedia_cities_page = Nokogiri::HTML(open('http://sv.wikipedia.org/wiki/Lista_%C3%B6ver_Sveriges_t%C3%A4torter')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = FactoryGirl.create(:herrljunga) | |
10.times {FactoryGirl.create(:user, :settings => FactoryGirl.create(:hetro_guy, :city => c))} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the migration | |
class CreateForumPosts < ActiveRecord::Migration | |
def self.up | |
create_table :forum_posts do |t| | |
t.string :title | |
t.text :message | |
t.integer :parent_id | |
t.timestamps | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/*' do | |
if request.host =~ /^www/ | |
redirect "http://" + request.host.gsub('www.','') + request.path, 301 | |
else | |
redirect "http://www." + request.host + request.path, 301 | |
end | |
end |