Skip to content

Instantly share code, notes, and snippets.

@neerajdotname
neerajdotname / Project-setup-on-Ubuntu.md
Created Apr 2, 2021 — forked from Gourav741/Project-setup-on-Ubuntu.md
This file might help you in the problems that you may face to setup Ruby on Rails project after dual boot installation of ubuntu(linux) on your local machine(windows based)
View Project-setup-on-Ubuntu.md

After the successful installation of Ubuntu(or other linux distro) on your windows machine, you may encounter a lot many issues setting up the Ruby on Rails project and it could be any or all of the below mentioned one:

View database_for_postgresql.yml
<% branch_name = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') %>
<% repository_name = `git rev-parse --show-toplevel`.split('/').last.strip %>
default: &default
adapter: postgresql
encoding: unicode
host: localhost
pool: 5
password:
View database_for_postgresqlapp.yml
<% branch_name = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '') %>
<% repository_name = `git rev-parse --show-toplevel`.split('/').last.strip %>
# Check https://gist.github.com/neerajdotname/b9d53f8a234da9d8c007de5e3d98bc21 to see
# details about the restriction on database name
# If you prefer to have branch name in the database name then use following
# database: <%= "#{repository_name}_development_#{branch_name}"[0...63] %>
development:
View why_database_name_only_63_characters_long.md

Why length of table name is limited to 63 characters long?

The default limit on length of identifiers in PostGreSQL is 63 because value of NAMEDATALEN constant is 64 by default. The length of identifiers is NAMEDATALEN - 1 which becomes 64 - 1 equal to 63.

This configuration can't be changed without compiling PostGreSQL again. We use name of the repository and name of branch to dynamically calculate database name for every branch. But if the length of this combination becomes greater than 63 then it gives error:

View akshay.txt
ahil Lavingia [12:55 PM] i wish there was a lot more urgency after deploying a huge codechange to be ready to fix any bugs stopping purchases from going through. been over a day with very critical bugs in production and i dont see a lot of hands-on-deck to get to stable position again
Sahil Lavingia [11:38 AM] Akshay kind of disappeared. that asap Braintree fix hasn't happened. been a full day since we discussed
I need to leave for a family event to attend. Will be back in 5 hours. @sahil - If you have any urgent issue to look into please let us know. Btw Vipul will be available for any urgent issue.
Yesterday, I also got fever. But now I am fine. Will work for some hours and try to resolve remaining issues.
Sahil Lavingia [11:52 AM] @akshay.vishnoi all issues are in GitHub now. would be great to get to issue zero for PayPal before weekend. consider these all urgent to fix Sahil Lavingia [12:35 PM] @akshay.vishnoi how is it going? [12:35] if possibel would be great to get some of your time over the weekend as
View main3.elm
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Html.beginnerProgram { model = model, view = view, update = update }
View main2.elm
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Html.beginnerProgram { model = model, view = view, update = update }
View main1.elm
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Html.beginnerProgram { model = model, view = view, update = update }
@neerajdotname
neerajdotname / cli.md
Created Jul 5, 2016 — forked from phrawzty/2serv.py
simple http server to dump request headers
View cli.md
$ curl -s -H "X-Something: yeah" localhost:8000 > /dev/null
$ python serv.py
ERROR:root:User-Agent: curl/7.37.1
Host: localhost:8000
Accept: */*
X-Something: yeah
View ventilated_prose_example.txt
---
layout: post
title: Author information in jekyll blog
published: true
categories: [ruby]
description: Author information in jekyll blog
author_github: neerajdotname
---
BigBinary's [blog](http://blog.bigbinary.com)