Skip to content

Instantly share code, notes, and snippets.

@t2ym
t2ym / gulpfile.js
Last active September 1, 2016 00:17
Integrate I18N transformers with Polymer CLI build process and gulp tasks with polymer-build library
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var debug = require('gulp-debug');
var gulpif = require('gulp-if');
var gulpignore = require('gulp-ignore');
var gulpmatch = require('gulp-match');
var sort = require('gulp-sort');
var grepContents = require('gulp-grep-contents');
@t2ym
t2ym / LeftWinAsAppsKeyAndRightAltAsLeftWin.reg
Last active November 4, 2016 08:50
FILCO Minila-like key mappings with Left Windows key for AutoHotKey assisted by SharpKeys
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,5d,e0,5b,e0,5b,e0,38,e0,\
00,00,00,00
@t2ym
t2ym / https-local-server.sh
Last active June 22, 2017 11:15
Script to launch local HTTPS server for watching local XLIFF files
#!/bin/sh
if [ "$1" = "" ]; then
echo Please specify the path to the root folder containing the target XLIFF file
echo $0 /Path/To/XLIFF/Folder
exit 1
fi
which openssl
if [ "$?" = "1" ]; then
echo Please install openssl command
@t2ym
t2ym / https-server.bat
Last active June 24, 2017 06:06
Batch file to launch local HTTPS server for watching local XLIFF files (Conversion Required for CRLF line ending for Windows)
@echo off
if "%1"=="" echo Please specify the path to the root folder containing the target XLIFF file
if "%1"=="" echo %0 C:\Path\To\XLIFF\Folder
if "%1"=="" goto :end
if exist C:\OpenSSL-Win64 set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg
if exist C:\OpenSSL-Win64 set PATH=%PATH%;C:\OpenSSL-Win64\bin
if exist C:\OpenSSL-Win32 set OPENSSL_CONF=C:\OpenSSL-Win32\bin\openssl.cfg
if exist C:\OpenSSL-Win32 set PATH=%PATH%;C:\OpenSSL-Win32\bin
if "%OPENSSL_CONF%"=="" echo Please install OpenSSL package for Windows from https://slproweb.com/products/Win32OpenSSL.html linked from https://wiki.openssl.org/index.php/Binaries
if "%OPENSSL_CONF%"=="" goto :end
@t2ym
t2ym / private.xml
Last active September 7, 2017 00:22
FILCO Minila-like key mapping with Left Command key and terminal tab switching with Scrollwheel (Left/Right) for Karabiner
<?xml version="1.0"?>
<root>
<item>
<name>Fn + Minila (with Command_L to Fn)</name>
<identifier>option.minilamode_fn</identifier>
<autogen>__KeyToKey__ KeyCode::S, ModifierFlag::FN, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::D, ModifierFlag::FN, KeyCode::CURSOR_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::E, ModifierFlag::FN, KeyCode::CURSOR_UP</autogen>
<autogen>__KeyToKey__ KeyCode::F, ModifierFlag::FN, KeyCode::CURSOR_RIGHT</autogen>
<autogen>__KeyToKey__ KeyCode::M, ModifierFlag::FN, KeyCode::FORWARD_DELETE</autogen>
@t2ym
t2ym / .Xmodmap
Created October 21, 2017 03:01
Minila keymap for X11 with US keyboard (Super_L(Windows_L) as Fn key feature in AltGr keycode)
remove mod4 = Super_L
keycode 133 = Mode_switch
keycode 24 = q Q q Q
keycode 25 = w W w W
keycode 26 = e E Up Up
keycode 27 = r R r R
keycode 28 = t T t T
keycode 29 = y Y y Y
keycode 30 = u U u U
@t2ym
t2ym / minila.json
Created November 11, 2017 08:12
Minila-like key mappings with left Cmd for Karabiner-Elements Complex Modifications Add Rules (~/.config/karabiner/assets/complex_modifications/minila.json)
{
"title": "Minila-like key mappings with left Cmd",
"rules": [
{
"description": "Minila-like key mappings with left Cmd",
"manipulators": [
{
"from": {
"key_code": "s",
"modifiers": {
@t2ym
t2ym / ldap_member_of.cc
Last active June 9, 2021 06:29
Prototype for accessor of memberOf attributes for LDAP users to be used for nicexprs.h middleware
/*
* Copyright (c) 2021, Tetsuya Mori <t2y3141592@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
@t2ym
t2ym / asio-sv.cc
Last active June 15, 2021 03:14
sample for nicexprs.h - based on nghttp2/examples/asio-sv.cc
/*
* nghttp2 - HTTP/2 C Library
*
* Copyright (c) 2014 Tatsuhiro Tsujikawa
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
@t2ym
t2ym / nghttp2-v1.43.0-ssl.patch
Last active June 15, 2021 07:45
Git patch to nghttp2-v1.43.0 to add const SSL *nghttp2::asio_http2::server::request::ssl() to associate client certificates with requests
diff --git a/src/asio_server.cc b/src/asio_server.cc
index 74c92276..5a79061e 100644
--- a/src/asio_server.cc
+++ b/src/asio_server.cc
@@ -154,7 +154,7 @@ void server::start_accept(boost::asio::ssl::context &tls_context,
return;
}
- new_connection->start();
+ new_connection->start(new_connection->socket().native_handle());