Skip to content

Instantly share code, notes, and snippets.

View palash25's full-sized avatar

Palash Nigam (He/Him) palash25

View GitHub Profile
@palash25
palash25 / System Design.md
Created April 13, 2018 04:54 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
make -C out BUILDTYPE=Release V=1
touch 0259e9499bc585bb497d97c96315cb50066e3cfb.intermediate
LD_LIBRARY_PATH=/home/palash25/Dev/Projects/node/out/Release/lib.host:/home/palash25/Dev/Projects/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /home/palash25/Dev/Projects/node/out/Release/obj/gen/src/inspector/protocol /home/palash25/Dev/Projects/node/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/home/palash25/Dev/Projects/node/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
rm 0259e9499bc585bb497d97c96315cb50066e3cfb.intermediate
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi
# Build the addons before running the tests so the test results
# can be displayed together
make -s build-addons
touch 0259e9499bc585bb497d97c96315cb50066e3cfb.intermediate
LD_LIBRARY_PATH=/home/palash25/Dev/Projects/node/out/Re
@palash25
palash25 / README.md
Created April 26, 2018 08:47 — forked from robertpainsi/README.md
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
Failures after changing Processing.py
=============================================================================================================================
====================================================== short test summary info ==============================================
FAIL tests/coalaCITest.py::coalaCITest::test_bear_dirs
FAIL tests/coalaCITest.py::coalaCITest::test_find_issues
FAIL tests/coalaCITest.py::coalaCITest::test_find_issues_debug
FAIL tests/coalaCITest.py::coalaCITest::test_find_no_issues
FAIL tests/coalaCITest.py::coalaCITest::test_find_no_issues_debug
FAIL tests/coalaCITest.py::coalaCITest::test_limit_files_affirmative
FAIL tests/coalaCITest.py::coalaCITest::test_section_ordering
@palash25
palash25 / FileFactoryPerf.txt
Created July 1, 2018 14:43
Results obtained by running analysis on FileFactory using 3 different approaches for accessing contents. The test file contains more than 1 million lines.
This analysis was run on a while of more than 10 million lines using 3 different approaches.
The results are given in the order of the least time taken to access the file contents.
=========================Using Cache + Memoization (`FileCache`+`lru_cache`)=========================
Raw: 0.25416111946105957
Lines: 1.6320154666900635
String: 3.814697265625e-06
import functools
class memoized_property:
"""
``memoized_property`` serves as a decorator to cache
the results of the properties like ``raw``, ``string``
and ``lines`` provided by ``FileFactory``.
"""
@palash25
palash25 / out.txt
Created July 16, 2018 13:52
Shell output after building !oss version of appbaseio/abc. Before executing the build ``govendor add +external`` was used
palash25@Lenovo-G50  ~/Dev/Projects/golang/gopath/src/github.com/appbaseio/abc   dev ●  go build -tags '!oss' ./cmd/abc/...
# github.com/appbaseio/abc/vendor/github.com/golang/protobuf/ptypes/any
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go:19:11: undefined: proto.ProtoPackageIsVersion2
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go:155:25: undefined: proto.InternalMessageInfo
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go:172:2: undefined: proto.RegisterType
vendor/github.com/golang/protobuf/ptypes/any/any.pb.go:175:15: undefined: proto.RegisterFile
# github.com/appbaseio/abc/vendor/github.com/golang/protobuf/ptypes/duration
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go:19:11: undefined: proto.ProtoPackageIsVersion2
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go:121:30: undefined: proto.InternalMessageInfo
vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go:138:2: undefined: proto.RegisterType
class FileDict(dict):
"""
Acts as a middleware to provide the bears with the
actual file contents instead of the `FileFactory`
objects.
"""
def __init__(self):
super().__init__()
def __setitem__(self, key, value):
super().__setitem__(key, value)
@palash25
palash25 / eth.doc
Created July 30, 2018 05:06 — forked from amitkumarj441/eth.doc
Ethereum Mining Setup
Check https://www.meebey.net/posts/ethereum_gpu_mining_on_linux_howto/
For Claymore setup:
https://bitcointalk.org/index.php?topic=1433925.0
http://1stminingrig.com/tutorial-ethereum-mining-rig-part-4-ethos-installation/
https://www.cryptocompare.com/mining/guides/how-to-mine-ethereum/
from collections import Iterable
from hashlib import sha1
import pickle
def order(obj):
"""
Recursively preserves the order of any sets or dicts
found in obj.
"""