Skip to content

Instantly share code, notes, and snippets.

View TSKGunGun's full-sized avatar
💭
I may be slow to respond.

Suguru Ueda TSKGunGun

💭
I may be slow to respond.
View GitHub Profile
@deconstructible
class RegexValidator:
regex = ''
message = _('Enter a valid value.')
code = 'invalid'
inverse_match = False
flags = 0
def __init__(self, regex=None, message=None, code=None, inverse_match=None, flags=None):
if regex is not None:
# Create your models here.
from django.db import models
from django.core.validators import RegexValidator
class NumValidator(RegexValidator):
regex = r'^[0-9]+\Z'
message = "ゼッケンNoは数字のみで入力してください。"
def __call__(self, value):
@TSKGunGun
TSKGunGun / docker-compose.yml
Last active September 9, 2021 06:44
Django+MariaDB(adminer) 環境構築
version: '3'
services:
db:
image: mariadb:10.6.4
restart: always
environment:
MARIADB_ROOT_PASSWORD: password
ports:
- 3306:3306
@TSKGunGun
TSKGunGun / sunsplots.py
Created August 20, 2021 02:58
Python基礎&実践プログラミング Ch21.5 swpcのデータがtxtではなくjson形式に変わっていたため、修正コード
from urllib.request import urlopen
from reportlab.graphics.shapes import *
from reportlab.graphics.charts.lineplots import LinePlot
from reportlab.graphics.charts.textlabels import Label
from reportlab.graphics import renderPDF
import json
URL = "https://services.swpc.noaa.gov/json/solar-cycle/predicted-solar-cycle.json"
drawing = Drawing(400, 200)
@TSKGunGun
TSKGunGun / AccessAnalyzer.bas
Created February 7, 2017 00:40
Access分析ツール
'------------------------------------------------------
'Software Name: Access 分析ツール
'FileName: AccessAnalyzer
'Author: Suguru Ueda
'Last Modifiy:2017/2/7
'------------------------------------------------------
Option Compare Database
Option Explicit
Public Function CreateFolder(strFolderPath As String)
' パスを\区切りで分ける
Dim varFolders As Variant ' フォルダ名リスト
varFolders = Split(strFolderPath, "\")
' FileSystemObjectをインスタンス化する
Dim objFileSystemObject As Object ' FileSystemObjectオブジェクト
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
@TSKGunGun
TSKGunGun / createfolder.vb
Last active February 6, 2017 09:50
再帰的にフォルダを作成
'再帰的にフォルダを作成
'複数階層で途中のパスのフォルダが存在しなくても作成できます
Public Sub CreateFolder(FolderFullPath As String)
' パスを\区切りで分ける
Dim FolderPaths As Variant ' フォルダ名リスト
FolderPaths = Split(FolderFullPath, "\")
Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject
@TSKGunGun
TSKGunGun / # vim - 2017-01-05_17-32-43.txt
Created January 5, 2017 08:34
vim on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for vim on macOS 10.11.6
Build date: 2017-01-05 17:32:43
@TSKGunGun
TSKGunGun / VBASampleAddin.cs
Created December 15, 2016 23:52
VBAでC#のdllを使うサンプル
using System;
using System.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace VBA_SampleAddin
{
[ComVisible(true)]
public interface IVBA_Addin
{
@TSKGunGun
TSKGunGun / RedisSample.cs
Created December 14, 2016 11:26
StackExchange.Redis Sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StackExchange.Redis;
namespace Redis_CSharp_Sample
{
class Program