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
BINARY_TO_EXTENTION = { | |
"\x89\x50\x4e\x47" : ".png", | |
"\xff\xd8\xdd\xe0" : ".jpeg", | |
"\xff\xd8\xff\xee" : ".jpg", | |
"\x47\x49\x46\x38\x39\x61" : ".gif", | |
"\x47\x49\x46\x38\x37\x61" : ".gif", | |
"\x42\x4d" : ".bmp", | |
"\x00\x2a" : ".tiff", | |
} |
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
#!-*- coding:utf-8 -*- | |
import htmlentitydefs | |
import re | |
# 実体参照 & 文字参照を通常の文字に戻す | |
def htmlentity2unicode(text): | |
# 正規表現のコンパイル | |
reference_regex = re.compile(u'&(#x?[0-9a-f]+|[a-z]+);', re.IGNORECASE) | |
num16_regex = re.compile(u'#x\d+', re.IGNORECASE) | |
num10_regex = re.compile(u'#\d+', re.IGNORECASE) |
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
# -*- coding:utf-8 -*- | |
# PutException.py | |
def PutException(filepath,_exception): | |
f = open(filepath,"a") | |
f.write(_exception) | |
if __name__ == '__main__': | |
try: | |
num = 0/0 |
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
<h3>関連記事</h3> | |
<ul class="rel-in clearfix"> | |
<?php | |
$tags = wp_get_post_tags($post->ID); | |
$tag_ids = array(); | |
foreach($tags as $tag): | |
array_push( $tag_ids, $tag -> term_id); | |
endforeach ; | |
$args = array( | |
'post__not_in' => array($post -> ID), |
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 sys;import requests | |
from bs4 import BeautifulSoup | |
import re | |
def getKeyword_withurl(url,lang): | |
headers = { | |
'User-Agent': | |
'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0' | |
} | |
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
RewriteEngine on | |
RewriteCond %{REQUEST_URI} ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ | |
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://nijipi.com/it-news/$4 [R=301,L] | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f |
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
/*@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document url("https://tweetdeck.twitter.com/") {*/ | |
body .app-content { | |
background-color: rgba(255,255,255,0.0); | |
} | |
body .app-columns-container { | |
background-image: url(http://www.project-imas.com/w/images/4/4a/Miku_SS_SSR2.png); |
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
<header id="#top" class="amp-wp-header"> | |
<div> | |
<a href="<?php echo esc_url( $this->get( 'home_url' ) ); ?>"> | |
<?php $site_icon_url = $this->get( 'site_icon_url' ); | |
if ( $site_icon_url ) : ?> | |
<amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img> | |
<?php endif; ?> | |
<?php echo esc_html( $this->get( 'blog_name' ) ); ?> | |
</a> | |
</div> |
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
# coding: UTF-8 | |
from mastodon import Mastodon | |
my_instance = "https://mastodon.cloud" | |
Mastodon.create_app( | |
'testapp', | |
api_base_url = my_instance, | |
to_file = 'pytooter_clientcred.txt' | |
) |
OlderNewer