Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

humble_wolf humblewolf

🏠
Working from home
View GitHub Profile
View test_basic_py_hash.py
import hashlib
import timeit
print(hashlib.algorithms_available)
print(hashlib.algorithms_guaranteed)
# hashing functions -------
def sha256fun(binp):
h = hashlib.sha256(binp)
return h.hexdigest()
@humblewolf
humblewolf / ror_cheatsheet.txt
Last active December 10, 2020 11:15
Ruby on Rails Cheatsheet
View ror_cheatsheet.txt
About Rails ::
1. Rails is a web framework which tries to do the heavy lifting for us (like django in py), you just need to insert code-snippets/files at pre-defined places and you are done most of the times.
2. Everything revolves around a resource, A resource is anything that can be created, updated, viewed, listed, deleted etc via http apis. For ex: For a blogging application an article can be a resource.
3. It is MVC arch : Model-View-Controller
Model:
1. Contains the blueprint/skleton of the resource (for ex. Article => Title, Body, Date-of-creation)
2. Tightly in association with DB, Typically a db table is created for every model and you can modify the record in the table by calling methods on your model object
Controller: