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 python:3.12 | |
# Install Chrome and Selenium dependencies | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
unzip \ | |
libglib2.0-0 \ | |
libnss3 \ | |
libgconf-2-4 \ | |
libfontconfig1 \ |
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
crontab -e |
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
steps: | |
# Install modules | |
- name: 'python' | |
entrypoint: pip | |
args: [ "install", "-r", "requirements.txt", "--user" ] | |
# Run unit tests | |
- name: python | |
args: ["python","-m","unittest"] | |
id: unittest |
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
@staticmethod | |
def to_int_number(text: str) -> int: | |
m = re.search(r'(\d+)', text) | |
if m is None: return 0 | |
num = m.group() | |
return int(num) |
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
<body> | |
<div class="SiteWrapper"> | |
<header>...</header> | |
<main>...</main> | |
<footer>...</footer> | |
</div> | |
</body> | |
<style> | |
.SiteWrapper { | |
display: flex; |
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
public class Utility { | |
public static void main(String[] args) throws Exception { | |
Utility utility = new Utility(); | |
String absolutePath = utility.getAbsolutePath("./credentials.json"); | |
} | |
public String getAbsolutePath(String relativeFilePath) throws IOException { | |
URL url = this.getClass().getResource(relativeFilePath); | |
return url.getPath(); |
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
public class Utility { | |
public static void main(String[] args) throws Exception { | |
Utility utility = new Utility(); | |
GoogleCredentials credentials = utility.getGoogleCredentials("./credentials.json"); | |
} | |
GoogleCredentials getGoogleCredentials(String jsonPath) throws IOException { | |
// You can specify a credential file by providing a path to GoogleCredentials. | |
// Otherwise credentials are read from the GOOGLE_APPLICATION_CREDENTIALS |
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
// コンタクトフォーム7 日本語判定 ここから | |
add_filter('wpcf7_validate_text', 'wpcf7_validate_yomigana', 11, 2); | |
add_filter('wpcf7_validate_text*', 'wpcf7_validate_yomigana', 11, 2); | |
function wpcf7_validate_yomigana($result,$tag){ | |
$tag = new WPCF7_Shortcode($tag); | |
$name = $tag->name; | |
$value = isset($_POST[$name]) ? trim(wp_unslash(strtr((string) $_POST[$name], "\n", " "))) : ""; | |
// 入力項目名が、'yomigana'の場合に実行 | |
if ( $name === "yomigana") { | |
// ひらがな・カタカナ以外だった場合 |
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
// コンタクトフォーム7 日本語判定 ここから | |
add_filter('wpcf7_validate_text', 'wpcf7_validate_yomigana', 11, 2); | |
add_filter('wpcf7_validate_text*', 'wpcf7_validate_yomigana', 11, 2); | |
function wpcf7_validate_yomigana($result,$tag){ | |
$tag = new WPCF7_Shortcode($tag); | |
$name = $tag->name; | |
$value = isset($_POST[$name]) ? trim(wp_unslash(strtr((string) $_POST[$name], "\n", " "))) : ""; | |
// 入力項目名が、'yomigana'の場合に実行 | |
if ( $name === "yomigana") { | |
// ひらがな・カタカナ以外だった場合 |
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
``` | |
// コンタクトフォーム7 日本語判定 ここから | |
add_filter('wpcf7_validate_textarea', 'wpcf7_validate_yomigana', 11, 2); | |
add_filter('wpcf7_validate_textarea*', 'wpcf7_validate_yomigana', 11, 2); | |
function wpcf7_validate_yomigana($result,$tag){ | |
$tag = new WPCF7_Shortcode($tag); | |
$name = $tag->name; | |
$value = isset($_POST[$name]) ? trim(wp_unslash(strtr((string) $_POST[$name], "\n", " "))) : ""; | |
// 入力項目名が、'yomigana'の場合に実行 | |
if ( $name === "yomigana") { |
NewerOlder