Skip to content

Instantly share code, notes, and snippets.

@neerajsingh0101
neerajsingh0101 / App.css
Created February 28, 2024 05:27 — forked from farhanlatheef/App.css
A simple react app with multiple languages (english and spanish) with translations automatically sentence cased. For example, "Send Message" will be displayed as "Send message"
.App {
font-family: 'Arial', sans-serif;
text-align: center;
margin: 20px;
}
h1 {
color: #333;
}
@neerajsingh0101
neerajsingh0101 / 10th-CBSE-CS-Assignments.txt
Last active December 17, 2021 10:54 — forked from vikas95prasad/questions.txt
10th-CBSE-CS-Assignments
1.Write a program to input a welcome message and print it.
2.Program to obtain three number and print their sum.
3.program to obtain length and breadth of a rectangle and calculate its area.
4.write a program to input a number and print its cube.
5.write a program to input two numbers and swap them.
@neerajsingh0101
neerajsingh0101 / longestPalindrome.js
Created November 9, 2021 10:34 — forked from ajith-k-v/longestPalindrome.js
JavaScript task: Find longest palindrome of the string "hellonevenlikestacocatandkayak"
function is_Palindrome(str1) {
var rev = str1.split("").reverse().join("");
return str1 == rev;
}
function longest_palindrome(str1){
var max_length = 0,
maxp = '';
@neerajsingh0101
neerajsingh0101 / Project-setup-on-Ubuntu.md
Created April 2, 2021 14:28 — 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)

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:

<% 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:
<% 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:

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:

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
module Main exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Html.beginnerProgram { model = model, view = view, update = update }