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 / gist:7924089
Created December 12, 2013 06:52
get url from magit log
(defun dev-gitweb-diff-url-from-magit ()
(interactive)
(let* (
(branch (magit-get-current-branch))
(remote (and branch (magit-get "branch" branch "remote")))
(remote-rebase (and branch (magit-get-boolean "branch" branch "rebase")))
(remote-branch (or (and branch (magit-remote-branch-for branch)) branch))
(remote-string (and remote remote-branch (magit-remote-string remote remote-branch remote-rebase)))
(remote-url (and remote (magit-get "remote" remote "url")))
@hanabokuro
hanabokuro / gist:7410579
Last active December 27, 2015 23:59
Text::Xslate. conbined utf string & utf bytes.
#!perl
use strict;
use warnings;
BEGIN{
# $ENV{XSLATE} = ' dump=ast '; # @@@ @@@
}
use Text::Xslate;
@hanabokuro
hanabokuro / cperl-mode : package.snippet
Created September 20, 2013 12:43
snippet for perl. expand "package".
# -*- mode: snippet -*-
# name: package
# key: package
# --
package ${1:`(if (string-match "/lib/\\(.*\\)\\.pm" buffer-file-name) (replace-regexp-in-string "/" "::" (match-string 1 buffer-file-name)) "")`};
use strict;
use warnings FATAL => qw(all);
$0
@hanabokuro
hanabokuro / toggle-camelcase-snakecase.el
Created September 20, 2013 12:39
toggle camelcase and snakecase.
(defun toggle-camelcase-and-snakecase ()
(interactive)
(let (start end bounds)
(if (and transient-mark-mode mark-active)
(progn
(setq start (mark))
(setq end (point)))
(let ((bounds (bounds-of-thing-at-point 'symbol)))
(when bounds