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
<meta name="twitter:card" content="player"> | |
<meta name="twitter:site" content="pronama"> | |
<meta name="twitter:title" content="暮井 慧 ボイス"> | |
<meta name="twitter:image:src" content="https://pronama.azurewebsites.net/voice/img/img0.png"> | |
<meta name="twitter:player" content="https://pronama.azurewebsites.net/voice/player.php/?no=A015&fc=0"> | |
<meta name="twitter:player:height" content="350"> | |
<meta name="twitter:player:width" content="350"> |
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
<?php | |
/* | |
Plugin Name: Post from photo | |
*/ | |
if (!isset($_SESSION)) { | |
session_start(); | |
} | |
require_once(ABSPATH . 'wp-load.php'); | |
require_once(dirname( __FILE__ ) . '/class-wp_post_helper.php'); // https://github.com/wokamoto/wp_post_helper |
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
(function($) { | |
$(".entry img").error(function() { | |
var m = /^http:\/\/i[0-2]\.wp\.com\/(.*)$/.exec($(this).attr("src")); | |
if (m && m[1]) { | |
$(this).attr("src", "http://" + m[1]); | |
} | |
return true; | |
}); | |
})(jQuery); |
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
<?php | |
// shortcode 処理 | |
// [foo bar="qux" baz="quux"] | |
add_shortcode('foo', 'rewrite_shortcode_func'); | |
function rewrite_shortcode_func($atts) { | |
// shortcode のパラメータ取得 | |
extract(shortcode_atts(array( | |
'bar' => 'qux', // bar 既定値 | |
'baz' => null // baz 既定値 |
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
<?php | |
// 保存時 shortcode の書き換え | |
add_filter('wp_insert_post_data', 'rewrite_shortcode_insert_post_data'); | |
function rewrite_shortcode_insert_post_data($data) { | |
// foo shortcode がなければ書き換えなし | |
if (false === has_shortcode($data['post_content'], 'foo')) { | |
return $data; | |
} | |
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
<?php | |
$converter = new Markdownify\ConverterExtra; | |
$converter->parseString('<h1 id="md">Heading</h1>'); | |
// Returns: # Heading {#md} | |
?> |
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
var reMarker = new reMarked({unsup_tags: {ignore: ""}}); // 出力しないタグなし | |
var markdown = reMarker.render(document.body); |
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 html2text | |
h = html2text.HTML2Text() | |
h.ignore_links = True | |
print h.handle("<p>Hello, <a href='http://earth.google.com/'>world</a>!") |
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
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"></script> | |
<script> | |
$(function () { | |
$("#text").change(function () { | |
console.log($(this).val()); // IE は text() でも取得できる | |
}); | |
}); | |
</script> |
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
a[7:0] = {<< {8'b1100_0101}}; // a = 8'b1010_0011 bit 逆順 | |
b[31:0]= {<< 8 {32'hDEAD_BEEF}}; // b= 32'hEFBE_ADDE 8bit 単位で並び替え (endian 変換) |