Skip to content

Instantly share code, notes, and snippets.

View mopeneko's full-sized avatar
😇

mopeneko

😇
View GitHub Profile
@mopeneko
mopeneko / insert_adcode_v3.php
Created July 3, 2023 19:02
[THE THOR] h2の上に広告コードを挿入する(1記事目はスキップ)
<?php
// h2の上に広告コードを挿入する
function insert_adcode($the_content) {
// 固定ページではそのまま表示
if (!is_single()) {
return $the_content;
}
$has_h2 = preg_match_all('/^<h2.*?>.+?<\/h2>$/im', $the_content, $h2_list, PREG_SET_ORDER);
@mopeneko
mopeneko / insert_adcode_v2.php
Last active July 3, 2023 18:28
[THE THOR] h2 のn番目以降に広告コードを挿入する m個飛ばし
<?php
// h2 のn番目以降に広告コードを挿入する
// m個飛ばし
function insert_adcode($the_content) {
$n = 2;
$m = 1;
// 固定ページではそのまま表示
if (!is_single()) {
return $the_content;
@mopeneko
mopeneko / add.py
Last active July 3, 2023 13:28
[Nexuspipe] Add Google bots IP addresses to Allowed IPs
import ipaddress
import itertools
import requests
AUTHORIZATION_HEADER = "Bearer xxxxxx"
APP = "example.com"
def get_ips(url):
resp = requests.get(url).json()
@mopeneko
mopeneko / .htaccess
Created July 3, 2023 12:13
WordPressのパーマリンクを基本から数字ベースに変えた後リダイレクトするやつ
<IfModule mod_rewrite.c>
RedirectMatch permanent (\?|\?(.+)&)p=(\d+)(&.+) https://mope-blog.com/archives/$3$1$4
</IfModule>
@mopeneko
mopeneko / insert_adcode.php
Last active July 3, 2023 12:13
[THE THOR] h2 のn番目に広告コードを挿入する
<?php
// h2 のn番目に広告コードを挿入する
function insert_adcode($the_content) {
$n = 2;
// 固定ページではそのまま表示
if (!is_single()) {
return $the_content;
}
@mopeneko
mopeneko / go_react.go
Created December 5, 2022 15:48
GoのSSRに部分的にReact+TSXを導入する
package main
import (
"io"
"log"
"net/http"
"text/template"
)
const (

Keybase proof

I hereby claim:

  • I am mopeneko on github.
  • I am mopeneko (https://keybase.io/mopeneko) on keybase.
  • I have a public key ASBJQgO3TMe2L-JwkhikT8HZwdb_sgZf6wf5GltpVhFGdQo

To claim this, I am signing this object:

@mopeneko
mopeneko / index.html
Created December 27, 2021 12:10
アナル
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
<style>
.error-message {
visibility: hidden
@mopeneko
mopeneko / .vimrc
Last active February 10, 2021 21:39
call plug#begin('~/.vim/plugged')
" Appearance
Plug 'vim-airline/vim-airline'
Plug 'arcticicestudio/nord-vim'
" Util
Plug 'preservim/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'jiangmiao/auto-pairs'
@mopeneko
mopeneko / docker-compose.yml
Last active April 26, 2020 11:52
Wiki.js builder for Docker Compose
version: "3.8"
services:
app:
image: requarks/wiki:2
restart: always
depends_on:
- db
environment:
DB_TYPE: postgres