Skip to content

Instantly share code, notes, and snippets.

@hanabokuro
hanabokuro / g3.js
Last active August 9, 2019 07:11
g(3)
'use strict'
let memo = {}
class B {
static f(n) {
return n + 1
}
static use_memo = false
@hanabokuro
hanabokuro / egg-make-bunsetsu.el
Created December 29, 2018 15:13
egg-make-bunsetsu for emacs 26
(defun egg-make-bunsetsu (backend bunsetsu last)
(let* ((converted (copy-sequence (egg-get-bunsetsu-converted bunsetsu)))
(language (egg-get-converted-language bunsetsu))
(continue (and (null last) (egg-major-bunsetsu-continue-p bunsetsu)))
(face (egg-get-conversion-face language))
len len1 prev-pos)
(setq len1 (length converted))
(or (eq last t)
(setq converted (concat converted
(if continue

ssh client log

debug1: Authentications that can continue: keyboard-interactive
debug3: start over, passed a different list keyboard-interactive
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
@hanabokuro
hanabokuro / sshd.md
Last active September 14, 2017 07:01
sshd_config

CentOS 7.3 OpenSSH 6.6.1

ChallengeResponseAuthentication yes
UsePAM yes
AuthenticationMethods publickey,keyboard-interactive
$ sudo sshd -t
<?php
class Foo {
static function throw_exception_maybe()
{
if(rand(0, 10) < 3) {
throw new Exception();
}
return 'xxx';
}
var Rx = require('rx')
var source0 =
Rx.Observable.timer(0, 500)
.map(function () {
if(Math.floor(Math.random() * 2) == 0){
return 'ズン'
}else{
return 'ドコ'
}
@hanabokuro
hanabokuro / get-string-region-at-cursor
Created August 18, 2015 06:00
Get region of string under cursor
(defun get-string-region-at-cursor ()
(save-excursion
(let (beg)
(setq beg (nth 8 (parse-partial-sexp 1 (point))))
(if beg
(progn
(goto-char beg)
(forward-sexp)
(list (1+ beg) (1- (point))))
nil)
'use strcit'
var Promise = require('bluebird');
function findUser(id) {
// return Promise.resolve({id: id})
return Promise.reject('not found')
}
var user = findUser(12)
@hanabokuro
hanabokuro / install_plevn.sh
Last active August 29, 2015 14:07
install plenv
sudo git clone https://github.com/tokuhirom/plenv.git /usr/local/plenv
sudo mkdir /usr/local/plenv/plugins
sudo git clone https://github.com/tokuhirom/Perl-Build.git /usr/local/plenv/plugins/perl-build
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install 5.18.2'
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install 5.20.1'
sudo sh -c 'PLENV_ROOT=/usr/local/plenv PATH="$PLENV_ROOT/bin/:$PLENV_ROOT/shims:$PATH" plenv install-cpanm'
@hanabokuro
hanabokuro / Vagrantfile
Created August 18, 2014 11:11
vagrantfile for apache storm - * not work yet *
# -*- mode: ruby -*-
VAGRANTFILE_API_VERSION = "2"
SERVERS = [
{ hostname: "storm", ssh_forward: 2302, networks: [ { ip: "192.168.0.2", virtualbox__intnet: "storm" } ] },
{ hostname: "nimbus", ssh_forward: 2303, networks: [ { ip: "192.168.0.3", virtualbox__intnet: "storm" } ] },
{ hostname: "server1", ssh_forward: 2304, networks: [ { ip: "192.168.0.4", virtualbox__intnet: "storm" } ] },
{ hostname: "server2", ssh_forward: 2305, networks: [ { ip: "192.168.0.5", virtualbox__intnet: "storm" } ] },
{ hostname: "server3", ssh_forward: 2306, networks: [ { ip: "192.168.0.6", virtualbox__intnet: "storm" } ] },
]