Skip to content

Instantly share code, notes, and snippets.

Tomohiro Kashiwada kikairoya

Block or report user

Report or block kikairoya

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kikairoya
kikairoya / seh.cc
Last active Jun 24, 2019
SEH for gcc (working)
View seh.cc
#include <stdio.h>
#include <windows.h>
#include <excpt.h>
#include <functional>
#pragma GCC optimize ("no-omit-frame-pointer")
//#define SEH_NO_CALL_DESTRUCTORS
#define SEH_ENABLE_TRACE
@kikairoya
kikairoya / wandbox.l
Last active May 29, 2019
post to wandbox from xyzzy
View wandbox.l
(eval-when (:compile-toplevel :load-toplevel :execute)
(require 'xml-http-request)
(require 'json))
(defpackage :wandbox
(:use :lisp :editor))
(in-package "wandbox")
(export '(post-wandbox-region post-wandbox post-wandbox-string show-compiler-list show-compiler-options))
@kikairoya
kikairoya / stdin_stream.hpp
Created Apr 9, 2011
boost::asio AsyncReadStream for console input
View stdin_stream.hpp
class stdin_stream: boost::noncopyable {
typedef boost::function<void (const boost::system::error_code &, size_t bytes_transferred)> read_handler_type;
public:
stdin_stream(boost::asio::io_service &io, HANDLE hin): io(io), hin(hin), hev(CreateEvent(0, 0, 0, 0)), handler(), buffer(0), size(0) {
_beginthread(&stdin_stream::thread_handler_gateway, 0, this);
}
~stdin_stream() {
buffer = 0;
CloseHandle(hev);
}
View tweeten-custom.css
.stream-item {
margin-bottom: 0px !important;
}
.item-box {
padding: 2px !important;
border-bottom: 1px solid gray;
}
.tweet {
display: flex !important;
flex-direction: column !important;
View make_array.cc
#include <array>
template <typename T, typename ...Args>
inline std::array<T, sizeof...(Args)> make_array(Args &&...args) {
return std::array<T, sizeof...(Args)>{ std::forward<Args>(args)... };
}
#define MAKE_ARRAY(T, ...) decltype(make_array<T>(__VA_ARGS__)){__VA_ARGS__}
#include <typeinfo>
View himatubusi.cpp
#include <tuple>
#include <type_traits>
using std::tuple;
template <int n>
struct int_: std::integral_constant<int, n> { };
typedef int_<0> zero_;
template <typename l>
struct decrement: int_<l::value-1> {
@kikairoya
kikairoya / hjkl.user.js
Created Jan 13, 2017
jjjjjjjjjjjjjjjjjj
View hjkl.user.js
(function() {
function _onkeypress(key) {
switch (key.key) {
case "h":
case "H":
window.scrollBy(-100, 0);
return false;
case "j":
case "J":
window.scrollBy(0, 100);
@kikairoya
kikairoya / _etc_profile.d_systemd.sh
Created Jun 24, 2013
Enables 'systemctl --user' without X11, dbus-launch, systemd-user-session
View _etc_profile.d_systemd.sh
if [ ! -S /run/user/$(id -u)/dbus/user_bus_socket ]; then
mkdir -p /run/user/$(id -u)/dbus
dbus-daemon --session --fork --address=unix:path=/run/user/$(id -u)/dbus/user_bus_socket --systemd-activation
fi
if ! systemctl --user > /dev/null 2> /dev/null; then
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/dbus/user_bus_socket /usr/lib/systemd/systemd --user & > /dev/null 2> /dev/null
fi
@kikairoya
kikairoya / open-vm-tools_PKGBUILD
Created Jan 18, 2014
AURのopen-vm-tools-dkmsが最近のkernelで動かなくなってるからUbuntuからパチってきた
View open-vm-tools_PKGBUILD
# patch -p1 <$srcdir/dkms-conf.patch
# $Id: PKGBUILD 102331 2013-12-09 03:38:37Z bisson $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Krzysztof Raczkowski <raczkow@gmail.com>
pkgbase=open-vm-tools
pkgname=('open-vm-tools' 'open-vm-tools-dkms')
epoch=6
pkgver=9.4.0
_pkgsubver=1280544
View gist:8489386
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDv94WPz35cGOR+OSae2rW+VLcx0L0stOAPZy8Ft1Ci6dzTNfKRhn1vHLIy85isZGf8r+ZsF04FGA7arcAuRxX5Zt6Gx10JLUN1PBRFEaoHKvKfYc/CezJlIINLXSOyiT8lUX6YQ7fYA4W4fDXWaat2UWdOQIh97sZngUxpWtknQ6lL4VqQaz2y5n0lHyCtBgGGEsExBe0haY2aLRykgygQfX8QufR7T5/6odjClRNLPdWAagg6fL/6ltTq6d1d7q8AQyxbPT6vvCtH+Vk3+VPGKBz+0bQWNI7jpnOgdLAK5e7wxQZ7OertXESfsGw/imBb+MM8UiRnuJVi4RsZjceH kikairoya@x240
You can’t perform that action at this time.