Skip to content

Instantly share code, notes, and snippets.

View Tosainu's full-sized avatar
🌸
ヾ( ╹◡╹ 🌸 )ノ"

Kenta Sato Tosainu

🌸
ヾ( ╹◡╹ 🌸 )ノ"
View GitHub Profile
@Tosainu
Tosainu / nyan.cc
Last active December 23, 2015 11:29
nyan
#include <iostream>
#include <chrono>
int main(int argc, char const* argv[]) {
const auto before = std::chrono::system_clock::now();
for (long long int i = 0; i < 100000000; i++) {
i + 1;
}
source 'https://rubygems.org'
gem 'slack-ruby-client'
gem 'eventmachine'
gem 'faye-websocket'
@Tosainu
Tosainu / build.bat
Last active March 21, 2016 03:12
Vim build script for Windows.
@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
rem Set Version
set VIM_VER=v7.4.1627
set LUA_VER=5.3.2
set PERL_VER=522
rem Set variables
#!/usr/bin/bash
if [ $# -ne 1 ]; then
echo "usage: $0 DEST"
exit -1
fi
if [ ! -d $1 ]; then
echo "error: no such directory $1"
exit -1
@Tosainu
Tosainu / Makefile
Last active June 14, 2016 13:13
seccamp'16 選択問題4
all: parser
parser: ./rhp.cc
clang++ -std=c++14 -Wall -Wextra -pedantic -O2 -march=native $< -o $@
debug: parser_debug
parser_debug: ./rhp.cc
clang++ -std=c++14 -Wall -Wextra -pedantic -g -O0 $< -o $@
#include <cstdint>
template <class Address, class Register, Address address>
struct reg_t {
static inline void write(Register value) {
*reinterpret_cast<volatile Address*>(address) = value;
}
static inline Register read() {
return *reinterpret_cast<volatile Address*>(address);
#include <iostream>
#include <unordered_map>
extern "C" {
#include <arpa/inet.h>
#include <sys/socket.h>
#include <ifaddrs.h>
}
std::unordered_map<std::string, std::string> get_if_list() {
QT += core gui webkitwidgets
TEMPLATE = app
TARGET = QWebView_example
INCLUDEPATH += .
SOURCES += main.cc
CONFIG += c++11
QT += core gui webkitwidgets
TEMPLATE = app
TARGET = QWebView_html-to-cpp
INCLUDEPATH += .
HEADERS += mainwindow.h jsobj.h
SOURCES += main.cc mainwindow.cc jsobj.cc
CONFIG += c++11
QT += core gui webkitwidgets
TEMPLATE = app
TARGET = QWebView_dom
INCLUDEPATH += .
HEADERS += mainwindow.h
SOURCES += main.cc mainwindow.cc
CONFIG += c++11