Skip to content

Instantly share code, notes, and snippets.

var t = new Date();
var count = new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
var offset = new Date(t.getFullYear(), t.getMonth(), 1).getDay();
var body = "";
for (var i = 0; i < offset; i++) {
body += " ";
}
for (var i = 1; i <= count; i++) {
body += (" " + i).slice(-2);
body += ((i + offset) % 7 == 0) ? "\n" : " ";
static void Main(string[] args)
{
var t = DateTime.Today;
var offset = (int)t.AddDays(-t.Day + 1).DayOfWeek; // 曜日の取得
var count = DateTime.DaysInMonth(t.Year, t.Month); // 月の日数の取得
Console.Write(new string(' ', offset * 3)); // 1週目の余白
for (var i = 1; i <= count; i++)
{
Console.Write(i.ToString().PadLeft(2) + // 1桁の日の空白パディング処理と日の出力
(((i + offset) % 7 == 0 || i == count) ? "\n" : " ")); // 日と日の間の空白出力と各週と最終日の改行処理
DTREAD(DATE$),Y,M,D
FOR I=1 TO M
READ C
NEXT
IF M==2 AND (Y%400==0 OR Y%4==0 AND Y%100!=0) THEN C=C+1
IF M<3 THEN Y=Y-1:M=M+12
W=(Y+(0OR Y/4)-(0OR Y/100)+(0OR Y/400)+(0OR(13*M+8)/5)+1)%7
FOR I=1 TO W
PRINT " ";
NEXT
<!DOCTYPE>
<html>
<body>
<form id="form1" runat="server">
<asp:Calendar ID="cal" runat="server" />
</form>
</body>
</html>
print("Pronama-chan")
# テクスチャの UV テーブル
spriteUV = ((0, 0, 0.125, 0.1875),
(0.125, 0, 0.125, 0.1875),
(0.25, 0, 0.125, 0.1875),
(0.375, 0, 0.125, 0.1875),
(0.5, 0, 0.125, 0.1875),
(0.625, 0, 0.125, 0.1875))
# スプライト制御
class PronamaChanSprite:
bl_info = {
"name": "Do Nothing Addon",
"category": ""}
def register():
pass
def unregister():
pass
<?php /*
Plugin Name: Do Nothing Plugin
*/ ?>
<?php
/*
Plugin Name: Pronama-chan shortcode
*/
add_shortcode('pronama-chan-icon', 'pronama_chan_icon_func');
function pronama_chan_icon_func($atts) {
return '<img src="http://pronama.azurewebsites.net/icogen/image/thumb01.png" />';
}
?>
<?php
/*
Plugin Name: Pronama-chan shortcode
*/
add_shortcode('pronama-chan-icon', 'pronama_chan_icon_func');
function pronama_chan_icon_func($atts) {
extract(shortcode_atts(array(
'msg' => 'おはよう!'
), $atts));