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:

@neerajsingh0101
neerajsingh0101 / cli.md
Created July 5, 2016 13:52 — forked from phrawzty/2serv.py
simple http server to dump request headers
$ 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
class PriceCalculator
ITEM_UNIT_PRICES = {
milk: 3.97,
bread: 2.17,
banana: 0.99,
apple: 0.89
}
['json','rest-client','pry'].each {|lib| require lib}
module Helper
def self.get_data_from_api(url)
response = RestClient.get url
response.force_encoding('utf-8')
JSON.parse response
end
end

This histogram shows the distribution of GitHub Gist API response times (in milliseconds) for a sample of 10,000 requests as observed by bl.ocks.org.

The distribution roughly follows a log-normal distribution, which is unsurprising for a complex process that has multiple independently-random sources of delay. The mode response time was in the range 120-140ms, while the median response time was 206ms. The middle 80% of requests were in the range 114-527ms. About 11% of requests took longer than 500ms, and 5% of requests took longer than one second. (The rightmost bin in the histogram includes these long requests.)

Since API endpoints vary dramatically in their computational cost, the distribution of response times is likely multimodal. In this dataset, 96% of requests were for a single gist (/gists/42), while the remaining 4% of requests were to list a user’s gist (/users/fred/gists). By separating the API requests for a single

source 'http://rubygems.org'
#gem 'rails', '4.0.0.beta1'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
module Anagram
class Dictionary < Hash
def initialize(dict_file="/usr/share/dict/american-english")
words = File.read(dict_file).split(?\n)
words.group_by(&:length).each do |k,v|
self[k] = v.group_by(&:chr)
end
end