This file contains 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 | |
function display_wordpress_user_auth() | |
{ ?> | |
<script> | |
<?php | |
$current_user = wp_get_current_user(); | |
if (isset($current_user)) { | |
if ($current_user->ID === 0) { | |
echo 'console.log(\'User is anonymous\');'; | |
} else { |
This file contains 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
const nodeRSA = require('node-rsa'); | |
const fetch = require('node-fetch'); | |
const publicKey = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbM2br48JS2JJy8Ajy0gy33Gu5RNAFgysUp4Mj9FqzXWg7AwdGaXc0vIAGG3vmyrP906qJpiEV1aW9GhsEGNQ9Mjmngfnu1VAKZjskVToqG1ktiXZJKSlVUfGTYj+r1lKDgd2iKt4azIzoeElk1gnLovn8zEaiCT7prHlzWWb7JgW3qp1e12e5WvSC5xX9P5iKOs6WM3qTSAX3e8qGeA9wtlHdQuDjSjWA0WlYQIFKgpoCBNZeldNxel79QgR7QKG6Oo/H4aImhDW9vXH00mGVy9QX11ngovVYPhCQWzsAo+v+Y2lAJUtFdjr2t9/mJisKxpYvpMeqVo2ZSydwBmb5' | |
const consumerId = 'change this to your consumer id' | |
const privateKey = "MIIEpAIBAAKCAQEAmzNm6+PCUtiScvAI8tIMt9xruUTQBYMrFKeDI/Ras11oOwMH\ | |
Rml3NLyABht75sqz/dOqiaYhFdWlvRobBBjUPTI5p4H57tVQCmY7JFU6KhtZLYl2\ | |
SSkpVVHxk2I/q9ZSg4HdoireGsyM6HhJZNYJy6L5/MxGogk+6ax5c1lm+yYFt6qd\ | |
XtdnuVr0gucV/T+YijrOljN6k0gF93vKhngPcLZR3ULg40o1gNFpWECBSoKaAgTW\ | |
XpXTcXpe/UIEe0ChujqPx+GiJoQ1vb1x9NJhlcvUF9dZ4KL1WD4QkFs7AKPr/mNp\ |
This file contains 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
#!/usr/bin/python3 | |
from datetime import datetime | |
import click | |
import requests | |
from py_imessage import imessage | |
def build_store_dict(zipcode, n): | |
url = f'https://www.walmart.com/grocery/v4/api/serviceAvailability?postalCode={zipcode}' |
This file contains 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 { useEffect, useState } from "react"; | |
export function useCustomHookDebugPattern(arg1, arg2, arg3, message, something, setSomething) { | |
// Watch for loop progress | |
const [count, setCount] = useState(1); | |
// Additional local state | |
const [prevMessageId, setPreviousMessageId] = useState(undefined); | |
useEffect(() => { | |
// Increment hook count |
This file contains 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 time | |
import base64 | |
import hashlib | |
import hmac | |
def generate_signature(sig_ingredients: dict) -> str: | |
"""Python 3.6+ implementation of Zoom Signature Generation |
This file contains 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
db_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization | |
db_1 | | |
db_1 | 2020-08-07 21:04:53.734 UTC [1] LOG: starting PostgreSQL 12.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit | |
db_1 | 2020-08-07 21:04:53.734 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 | |
db_1 | 2020-08-07 21:04:53.734 UTC [1] LOG: listening on IPv6 address "::", port 5432 | |
db_1 | 2020-08-07 21:04:53.738 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" | |
db_1 | 2020-08-07 21:04:53.771 UTC [20] LOG: database system was shut down at 2020-08-07 21:04:52 UTC | |
db_1 | 2020-08-07 21:04:53.775 UTC [1] LOG: database system is ready to accept connections | |
db_1 | 2020-08-07 21:05:24.660 UTC [30] LOG: invalid length of startup packet | |
db_1 | |
This file contains 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
@receiver(post_save, sender=User) | |
def create_user_profile(sender, instance, created, **kwargs): | |
# When user is created, build user profile and create payinfo instance. | |
# See also accounts.forms.SignupForm.signup for other signup steps | |
if created: | |
profile = Profile.objects.create(user=instance) | |
profile.payment_info = PaymentInfo.objects.create() | |
try: | |
instance.profile.account_type = AccountType.objects.get(name='Basic') | |
except AccountType.DoesNotExist: |
This file contains 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
class Profile(TimeStampedModel): | |
user = models.OneToOneField(User, null=True, blank=True, related_name='profile', on_delete=models.CASCADE) | |
organization = models.ForeignKey('home.Organization', null=True, blank=True, on_delete=models.CASCADE) | |
personal_data = models.OneToOneField('PersonalData', null=True, blank=True, on_delete=models.CASCADE) | |
... |
This file contains 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
# Squash X commits with an opportunity to update the message headline and body: | |
git reset --soft HEAD~X && | |
git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})" |
This file contains 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
@admin.register(CustomUser) | |
class CustomUserAdmin(UserAdmin): | |
fieldsets = UserAdmin.fieldsets + (('Custom Info', {'fields': ('account_type', 'address1', 'address2', 'city', 'state', 'zip', 'phone', 'sms_consent', 'onesignal_id',)}),) | |
list_display = UserAdmin.list_display + ('account_type',) | |
list_filter = UserAdmin.list_filter + ('account_type',) | |
icon = '<i class="material-icons">person</i>' |