Skip to content

Instantly share code, notes, and snippets.

View oguna's full-sized avatar

oguna

  • Minatomirai, Kanagawa, Japan
View GitHub Profile
@oguna
oguna / gist:6551492
Last active December 23, 2015 00:09

aiueo

Left align Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned
@oguna
oguna / gist:6879897
Last active December 24, 2015 23:19
BFP4Fのスクリプトの解説。P4Fで「手当は必要か?」(TeatehaHituyoka?)でプレイしてます

メモ

スクリプトファイルの探し方

Windows7(64bit)の場合...... C:\Program Files (x86)\EA Games\Battlefield Play4Free\mods\main\Objects\Weapons_server.zip このZIPファイルをどこか安全な場所(デスクトップなど)にコピーし、そこで展開。 展開したフォルダのHandheldに武器のスクリプトファイルがある。 「AR_416Carbine_Default」というディレクトリがあるが、 ARはアサルトライフル、416Carbineは武器名、Defaultはデフォルト(+3武器でない)ことを意味する。 このディレクトリを開くと、「.con」拡張子のファイルがあり、これがスクリプトファイルである。

@oguna
oguna / GlobeCamera.cs
Created December 29, 2013 10:28
DXUTのModelViewCameraっぽいのをC#で書いた。SharpDXでの利用を想定。マウス入力はフォームにイベントハンドラを与えることで取得する。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using SharpDX;
namespace MeshFromOBJ
{
@oguna
oguna / markdown2html.py
Last active June 26, 2023 16:27
Github APIを用いてMarkdownをHTMLに変換するPythonスクリプト
#!/usr/bin/env python
# this script on only PYTHON3
import urllib.request
import urllib.parse
with open('index.md','br') as file:
data = file.read()
request = urllib.request.Request('https://api.github.com/markdown/raw')
request.add_header('Content-Type','text/plain')
f = urllib.request.urlopen(request,data)
with open('index.html','bw') as file:
@oguna
oguna / Pmd.h
Created June 24, 2014 13:48
MMDのPMDファイルのパーサー
// Copyright oguna 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <vector>
#include <string>
#include <memory>
#include <iostream>
#include <fstream>
@oguna
oguna / Vmd.h
Created June 24, 2014 13:51
MMDのVMDモーションファイルのパーサー。C++11の機能を使っている
// Copyright oguna 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <vector>
#include <string>
#include <memory>
#include <iostream>
#include <fstream>
@oguna
oguna / main.cpp
Created June 24, 2014 16:05
ファイルから読み込んでstd::stringにするのと、char[]にするもののサンプル
#include <iostream>
#include <memory>
#include <fstream>
#include <string>
#include <codecvt>
#include <regex>
using namespace std;
unique_ptr<string> readToEndForString(char* filename)
@oguna
oguna / gist:d83a5a6df5eeb9b178d8
Created August 7, 2014 13:52
QtでDirectXなどの描画をする際は、winId()のハンドラを使う。
QD3D11Widget::QD3D11Widget(QWidget *parent) :
QWidget(parent)
{
// バッファリングをしないようにする
setAttribute(Qt::WA_PaintOnScreen, true);
// ハンドラの再利用を禁止する
setAttribute(Qt::WA_NativeWindow, true);
m_hWnd = (HWND)winId();
HRESULT hr = InitDevice();
}
@oguna
oguna / gist:e6e02fc2465dae118641
Created August 19, 2014 12:56
NDLのJsonデータをC#シリアライザでデシリアイズする
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
@oguna
oguna / gist:ed5f607d10ee21b4dc50
Created October 28, 2014 09:53
PandocでMarkdownをHTMLに変換するバッチファイル
REM Pandocを使ってMarkdown(.md)をHTML(.html)に変換するバッチ
REM -f : 変換元フォーマット
REM -t : 変換先フォーマット
REM -o : 出力先ファイル
REM -c : CSSファイル
pandoc -f markdown -t html5 -o index.html -c css/github.css index.md
REM エラーなら停止する
if %ERRORLEVEL% NEQ 0 (pause)