Skip to content

Instantly share code, notes, and snippets.

View avellable's full-sized avatar

Mahesh Baheti avellable

View GitHub Profile
@avellable
avellable / hello_world.py
Created March 31, 2020 14:27
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
Process: ruby [18193]
Path: /Users/USER/*/ruby
Identifier: ruby
Version: 0
Code Type: X86-64 (Native)
Parent Process: zsh [44982]
Responsible: ruby [18193]
User ID: 501
Date/Time: 2019-11-08 14:07:27.233 +0900
@avellable
avellable / Lie
Created October 6, 2016 10:44
Someone once told me that I'm stupid and never gonna make it big in life. Here's how I proved them wrong:
I lied. I didn't prove them wrong. They were right.
@avellable
avellable / erlang-resources.md
Last active August 29, 2015 14:25 — forked from macintux/erlang-resources.md
Erlang online resources
==> Delegates
- Law of demeter
The Law of Demeter (LoD), or Principle of Least Knowledge, is a simple design style for developing software with the following guidelines:
Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
Each unit should only talk to its friends; don't talk to strangers.
Only talk to your immediate friends.
- Simpler definition
You can play with yourself.
==> Validations
==> Login Page
- Username
- Wrong username: "Wrong credentials"
- Password
- Wrong Password: "Wrong credentials"
==> Survey Creation
- Empty Question Field: Not Allowed
- Question Types
a=[3,5,7,3,3,5]
i=0
j=a.length-1
N=j
while i<N-1 do
while j>=0 do
if (a[0..i]-a[j..N]).size == 0
count+=1
end
@avellable
avellable / gist:6117881
Created July 30, 2013 23:10
seek error
1.9.3-p448 :003 > while file.getc != '\n'
1.9.3-p448 :004?> file.seek(-2,IO::SEEK_CUR)
1.9.3-p448 :005?> end
Errno::EINVAL: Invalid argument - test
from (irb):4:in `seek'
from (irb):4
from /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/irb:16:in `<main>'