Skip to content

Instantly share code, notes, and snippets.

@akihiroy
akihiroy / git-example.sh
Last active September 28, 2020 20:22
git example
# Clean up backup and loose objects.
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
# 全ての履歴に .gitignore / .gitattributes を追加する
git filter-branch --index-filter "cp -t ./ ../.gitignore ../.gitattributes && git add .gitignore .gitattributes" -f -- --all
7zip.install
git.install
git-lfs
sourcetree
firacode
sublimetext3
hidemaru-editor
wixtoolset
adobereader
googlejapaneseinput
@akihiroy
akihiroy / merge_sort.cpp
Created February 15, 2013 10:34
Merge Sort
#include <algorithm>
#include <iterator>
#include <vector>
template<class FI, class P, class TI>
void merge_sort_impl(FI first, FI last, P pred, TI temp)
{
size_t size = std::distance(first, last);
if (size == 1) {
return;
@akihiroy
akihiroy / stack_trace.cpp
Created January 22, 2013 09:53
Stack trace function for windows
#include <windows.h>
#define DBGHELP_TRANSLATE_TCHAR
#include <DbgHelp.h>
void StackTrace()
{
CONTEXT context = {0};
#if defined(_M_X64)
RtlCaptureContext(&context);
#else
@akihiroy
akihiroy / overwrite_queue.h
Created April 20, 2011 10:56
overwrite_queue for Microsoft Asynchronous Agents Library
namespace Concurrency
{
template<class _Type>
class overwrite_queue : public propagator_block<multi_link_registry<ITarget<_Type>>, multi_link_registry<ISource<_Type>>>
{
private:
message<_Type> * _M_pMessage; ///< The message being stored
message<_Type> * _M_pReservedMessage; ///< The message being reserved
@akihiroy
akihiroy / jitasm_sample.cpp
Created February 2, 2011 06:55
jitasm sample
// レジスタ割り当てを行うサンプル
struct func_compiler : jitasm::function_cdecl<int, func_compiler, int, int *, double, POINT>
{
Result main(Reg32 a, Reg b, XmmReg c, Addr d)
{
Reg32 v;
mov(v, a); // aをレジスタとしてmov
add(v, dword_ptr[b]);
#include <string>
#include <vector>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_object.hpp>
#include <boost/spirit/include/phoenix_stl.hpp>
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/fusion/include/adapt_struct.hpp>