Skip to content

Instantly share code, notes, and snippets.

hanabokuro

Block or report user

Report or block hanabokuro

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
View g3.js
'use strict'
let memo = {}
class B {
static f(n) {
return n + 1
}
static use_memo = false
@hanabokuro
hanabokuro / egg-make-bunsetsu.el
Created Dec 29, 2018
egg-make-bunsetsu for emacs 26
View egg-make-bunsetsu.el
(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
View ssh_log.md

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 Sep 14, 2017
sshd_config
View sshd.md

CentOS 7.3 OpenSSH 6.6.1

ChallengeResponseAuthentication yes
UsePAM yes
AuthenticationMethods publickey,keyboard-interactive
$ sudo sshd -t
View memory_leak.php
<?php
class Foo {
static function throw_exception_maybe()
{
if(rand(0, 10) < 3) {
throw new Exception();
}
return 'xxx';
}
View zundoko.js
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 Aug 18, 2015
Get region of string under cursor
View get-string-region-at-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)
View test.js
'use strcit'
var Promise = require('bluebird');
function findUser(id) {
// return Promise.resolve({id: id})
return Promise.reject('not found')
}
var user = findUser(12)
View install_plevn.sh
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 Aug 18, 2014
vagrantfile for apache storm - * not work yet *
View Vagrantfile
# -*- 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" } ] },
]
You can’t perform that action at this time.