column1 | column2 | column3 |
---|---|---|
I am a sentence | 30 | category1 |
I am a bigger sentence | 40 | category2 |
thats it | 20 | category3 |
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
@Configuration | |
public class FireStoreConfig { | |
@Bean | |
public Firestore getFireStore(@Value("${firebase.credential.path}") String credentialPath) throws IOException { | |
var serviceAccount = new FileInputStream(credentialPath); | |
var credentials = GoogleCredentials.fromStream(serviceAccount); | |
var options = FirestoreOptions.newBuilder() | |
.setCredentials(credentials).build(); |
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
from functools import wraps | |
class Loggable: | |
def __init__(self, view_class, log_exception=True): | |
self.view_func = view_class | |
self.logger = self._get_logger() | |
def as_view(self, *args, **kwargs): | |
self.view_func = self.view_func.as_view(*args, **kwargs) |
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
SET global general_log_file='/var/log/mysql/all.log'; | |
SET global log_output = 'file'; | |
SET global general_log = 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
create database cibling_db; | |
CREATE USER cblinguser WITH PASSWORD 'cblinguser456789'; | |
ALTER ROLE cblinguser SET client_encoding TO 'utf8'; | |
ALTER ROLE cblinguser SET default_transaction_isolation TO 'read committed'; | |
ALTER ROLE cblinguser SET timezone TO 'UTC'; | |
GRANT ALL PRIVILEGES ON DATABASE cibling_db TO cblinguser; | |
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
myproject | |
├── manage.py | |
└── myproject | |
├── __init__.py | |
├── settings.py | |
├── urls.py | |
└── wsgi.py |
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
myproject | |
├── manage.py | |
└── root | |
├── __init__.py | |
├── settings.py | |
├── urls.py | |
└── wsgi.py |
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
myseq = "" | |
for s in SeqIO.parse('file.fasta', 'fasta'): | |
if s.id == "12345": | |
myseq = s.seq | |
break |
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
## model ### | |
class ModelA(models.model): | |
field_a = | |
field_b = | |
class ModelB(models.model): | |
model_a = models.Foreignkey(ModelA) | |
field_C = | |
## model ##### |
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 OriginRestrictor(get_response): | |
def middleware(request): | |
forbid = False | |
for method in ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']: | |
if request.method==method and method in method_remote.keys(): | |
allowed_origin = method_remote[method] | |
request_origin = request.META['REMOTE_ADDR'] | |
if request_origin not in allowed_origin: | |
forbid=True |