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 import_fields(self, alerts): | |
residents = self.meta.tables['application_resident'] | |
for alert in alerts: | |
resident = self.get_fields(alert) | |
query = residents.select((residents.c.resident_number == resident['resident_number']) & (residents.c.facility_id == resident['facility_id'])) | |
hello = query.execute() | |
rows = hello.fetchall() | |
if not rows: | |
insert_stmt = insert(self.meta.tables['application_resident']).values(resident) | |
self.con.execute(insert_stmt) |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name profiles.themuse.com www.profiles.themuse.com; | |
location / { | |
include proxy_params; | |
proxy_pass http://unix:/opt/src/profiles/profiles.sock; | |
} |
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
[Unit] | |
Description=Gunicorn Muse Profiles | |
After=network.target | |
[Service] | |
User=root | |
Group=www-data | |
WorkingDirectory=/opt/src/profiles | |
ExecStart=$path_to_gunicorn_binary/gunicorn --access-logfile - --workers 4 --bind unix:/opt/src/profiles profiles.wsgi:application |
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
{ | |
"preferred_drug_data": [{ | |
"drug_name": "Tylenol", | |
"tier_level": "1" | |
}, | |
{ | |
"drug_name": "Tylenol Extra Strength", | |
"tier_level": "2" | |
}, | |
{ |
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
import datetime | |
date_string = '2019-01-22' | |
date_format = '%Y-%m-%d' | |
try: | |
date_obj = datetime.datetime.strptime(date_string, date_format) | |
print(date_obj.date()) | |
except ValueError: | |
## pass 400 error here incorrect date format message | |
print("Incorrect data format, should be YYYY-MM-DD") |
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
app.use('/api', totoro.rain({ | |
v1: { | |
endpoints: [ | |
{ | |
route: "/create-user", | |
method: "GET", | |
implementation: routes.v1.createUser | |
}, | |
{ | |
route: "/delete-user", |
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
<?php | |
/*amOmMQfUYVN0OxwwRjomMCHT1A0KOZXoCl | |
2wjQHwPWkBI2lxexzlHpmH12gOgizxwrkV | |
INEsONk1AEozqvfS3WJZkp8aduIDGFvOS18hDhXDmC4S | |
kqvuFWaCx4x674BsHUiF2lmPoORhhF8Hws32FS | |
LrxIkz1sJZxBAaQpoiNLoKTa3MR9eM1q4ozedpNmEBnFb5uG | |
*/ | |
//miBy10TC1A7ezb8fokkqNqHIaOlZhthJ |
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
<?php | |
class Registration | |
{ | |
function __construct($user, $password) { | |
$this->user = $user; | |
// salt should be stored in .env file | |
$this->password = crypt($password, '$2a$09$tdfndZfdksdddf$'); | |
} |
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
<?php | |
$urls = ["/admin/scripts/vuln.php", "/admin/scripts/unsafe.php", "/admin/lib/blocked.php"]; | |
foreach ($urls as $url) { | |
if (preg_match("/\/admin\/scripts\/vuln.php/", $url) | |
|| preg_match("/\/admin\/scripts\/unsafe.php/", $url) | |
|| preg_match("/\/admin\/lib\/blocked.php/", $url) | |
) { | |
echo "block url<br/>"; |
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
<?php | |
class Registration | |
{ | |
function __construct($user, $password) { | |
$this->user = $user; | |
// salt should be stored in .env file | |
$this->password = crypt($password, '$2a$09$tdfndZfdksdddf$'); | |
} |
NewerOlder