This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
celery -A project-name worker --pool=solo -l info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\du | |
ALTER USER yourusername WITH PASSWORD 'yournewpass'; | |
CREATE USER yourname WITH SUPERUSER PASSWORD 'yourpassword'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.makeareadme.com/ | |
# Foobar | |
Foobar is a Python library for dealing with word pluralization. | |
## Installation | |
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar. | |
```bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove local branch | |
git branch -d branchname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://serverfault.com/questions/110154/whats-the-default-superuser-username-password-for-postgres-after-a-new-install | |
In Windows, do the following (IMPORTANT: Use a Windows administrator account): | |
After installation, open <PostgreSQL PATH>\data\pg_hba.conf. | |
Modify these two lines, and change "md5" to "trust": | |
host all all 127.0.0.1/32 md5 | |
host all all ::1/128 md5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create virtual environment in this folder called env | |
python -m venv env | |
# activate it | |
env\Scripts\activate.bat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_datetime(string): # provided | |
string = string.split(' ') | |
date_str = string[0].split('/') | |
time_str = string[1].split(':') | |
date_int = [int(x) for x in date_str] | |
time_int = [int(x) for x in time_str] | |
return datetime.datetime(date_int[2], date_int[1], date_int[0], time_int[0], time_int[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_csv(filename): # provided | |
with open(filename, 'r') as f: | |
lines = csv.reader(f, delimiter=',') | |
return tuple(lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You probably need to set a size that is way larger than expected file size, | |
# if not you still may receive this 413 Request entity too large error | |
server { | |
client_max_body_size 100M; | |
... | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number of Combinations = 2**(length of input set) | |
# Makes use of binary | |
def PowerSet(input): | |
ans = [] | |
numOfComb = 2 ** len(input) | |
for combidx in range(numOfComb): # 0 -> numOfComb | |
temp = [] | |
for setidx in range(len(input)): # 0 -> len(input) | |
if combidx & 1 << setidx: # bitwise operation e.g. 0 & 1 << 0 =>0 | |
temp.append(input[setidx]) |