Posts marked with "Ruby" in tags

Use ActiveRecord + SQLite without Rails

Recently been using ActiveRecord + SQLite a LOT, so making this post for the basic template.

Gemfile

source "https://rubygems.org"

gem "activerecord", "~> 8.0"
gem "pry"

gem "sqlite3", "~> 2.4"

playground.rb

require 'active_record'
require 'pry'
require 'sqlite3'

ActiveRecord::Base.establish_connection(
  adapter: 'sqlite3',
  database: 'db.sqlite3'
)

class Place < ActiveRecord::Base
end

@first_run = !Place.table_exists?

# Create the table (migration-like setup)
if @first_run
  ActiveRecord::Schema.define do
    create_table :places do |t|
      t.string :name
      t.string :lat
      t.string :lon
      t.timestamps
    end
    add_index :places, :name, unique: true
  end
end

binding.pry
... [READ MORE]

Simple analysis of place names in Kerala

Update

After this post was published, some people asked for some other suffixes to be analyzed. I’ve now made an interactive webpage to analyse place names in any way with SQL:

Intro

I noticed something unique when I walked around in Kakkanad, some of the local place names ended with the word “മുഗൾ”.

Nilampathinjamugal

I haven’t heard of any other place having this suffix in Kerala before, so it was quite interesting to me. The curiosity instantly brewed in my mind, is this really specific to Kakkanad? Why so?

... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab