$ pip install PyAutoGUI==0.9.52
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/env python | |
from requests import Session | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.util import Retry | |
def main(): | |
retries = Retry( | |
total=5, | |
backoff_factor=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
package org.ryu22e; | |
import org.junit.Test; | |
import org.junit.experimental.runners.Enclosed; | |
import org.junit.runner.RunWith; | |
/** | |
* @author ryu22e | |
* @see <a href="http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690">http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690</a> | |
*/ |
See: https://www.djangoproject.com/weblog/2020/jun/03/security-releases/
>>> from django.core.cache import cache
>>> cache.set('my_key', 'hello, world!')
>>> cache.get('my_key')
'hello, world!'
>>> c = chr(33)
>>> c
'!'
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
javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(`[${document.title}](${location.href})`); |
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
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ | |
-H "Content-Type: application/json" \ | |
https://api.github.com/repos/ryu22e/django_demo/deployments/${DEPLOYMENT_ID}/statuses \ | |
--data '{"state": "success"}' |
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
"""悪い例""" | |
from django.conf import settings | |
from django.db import models | |
class Bug(models.Model): | |
pass | |
class Comment(models.Model): |
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
"""悪い例""" | |
from django.db import models | |
class Product(models.Model): | |
name = models.CharField(max_length=1000) | |
account_id = models.CharField(max_length=100) # カンマ区切りでIDを入れる(例: '1,2,3') |
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
# example/models.py | |
from django.db import models | |
from django.contrib.postgres.fields import JSONField | |
class Example(models.Model): | |
value = JSONField(verbose_name="値") | |
enabled = models.BooleanField(verbose_name="有効") |
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
from django.db import models | |
class Book(models.Model): | |
title = models.CharField(max_length=50, verbose_name="タイトル") |