Skip to content

Instantly share code, notes, and snippets.

View waltertschwe's full-sized avatar

Walter Schweitzer waltertschwe

  • Schweitzer Technology LLC
  • Brooklyn, NY
View GitHub Profile
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)
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;
}
[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
{
"preferred_drug_data": [{
"drug_name": "Tylenol",
"tier_level": "1"
},
{
"drug_name": "Tylenol Extra Strength",
"tier_level": "2"
},
{
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")
app.use('/api', totoro.rain({
v1: {
endpoints: [
{
route: "/create-user",
method: "GET",
implementation: routes.v1.createUser
},
{
route: "/delete-user",
<?php
/*amOmMQfUYVN0OxwwRjomMCHT1A0KOZXoCl
2wjQHwPWkBI2lxexzlHpmH12gOgizxwrkV
INEsONk1AEozqvfS3WJZkp8aduIDGFvOS18hDhXDmC4S
kqvuFWaCx4x674BsHUiF2lmPoORhhF8Hws32FS
LrxIkz1sJZxBAaQpoiNLoKTa3MR9eM1q4ozedpNmEBnFb5uG
*/
//miBy10TC1A7ezb8fokkqNqHIaOlZhthJ
<?php
class Registration
{
function __construct($user, $password) {
$this->user = $user;
// salt should be stored in .env file
$this->password = crypt($password, '$2a$09$tdfndZfdksdddf$');
}
<?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/>";
<?php
class Registration
{
function __construct($user, $password) {
$this->user = $user;
// salt should be stored in .env file
$this->password = crypt($password, '$2a$09$tdfndZfdksdddf$');
}