Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

💭
I may be slow to respond.
View GitHub Profile
@tomoh1r
tomoh1r / README.md
Created Mar 22, 2020
Windows Terminal
View README.md

C:\Users\USERNAME\AppData\Local\Packages\Microsoft.WindowsTerminal_rnd\LocalState\profiles.json

"profiles": {
    "defaults": {
        "fontFace": "Migu 1M",
        "fontSize": 11
    },
    "list": [
        ...
@tomoh1r
tomoh1r / README.md
Created Dec 11, 2016
Fluentd + Elasticsearch + Kibana and send local journald logs.
View README.md

ex-fek

Fluentd + Elasticsearch + Kibana

and send local journald logs.

$ sudo dnf install docker docker-compose
$ docker-compose build
@tomoh1r
tomoh1r / index.html
Last active Dec 25, 2015
angular simple example
View index.html
<!doctype html>
<html lang="en" ng-app="front">
<head>
<meta charset="utf-8">
<title>angular simple example</title>
</head>
<body>
<!-- update this div -->
<div ng-view></div>
@tomoh1r
tomoh1r / some.js
Created Dec 21, 2015
ES5 のオブジェクトテスト
View some.js
> function Some() { this.say = say; return this; function say(msg) { console.log(msg); } }
undefined
> Some().say('あいうえお');
あいうえお
undefined
@tomoh1r
tomoh1r / some.py
Created Nov 23, 2015
decorator でラップされた対象を控えておく
View some.py
>>> lst = []
>>> def deco(f):
... lst.append(f)
...
>>> @deco
... def main():
... pass
...
>>> print(['{f.__module__}.{f.__name__}'.format(f=f) for f in lst])
['__main__.main']
@tomoh1r
tomoh1r / みためはこちらのほうがすき.lsp
Created Oct 27, 2015
インデントとかはこちらのほうがすき
View みためはこちらのほうがすき.lsp
(defun fact (n &optional m) (
if (zerop n)
m
(fact (1- n) (if m (* m n) n))
))
@tomoh1r
tomoh1r / result.txt
Created Aug 13, 2015
Python で辞書を作る
View result.txt
>>> timeit.timeit('{x: x for x in range(10000)}', number=1000)
0.5202829837799072
>>> timeit.timeit('dict((x, x) for x in range(10000))', number=1000)
1.0116031169891357
@tomoh1r
tomoh1r / dump_fizzbuzz_001.py
Last active Aug 29, 2015
15個 fizz/buzz のリスト作ってから yield で fizzbuzz
View dump_fizzbuzz_001.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
def fizzbuzz():
loop = [
None,
None,
'fizz',
None,
@tomoh1r
tomoh1r / gist:3560df167c7ce41021bb
Last active Aug 29, 2015
msys2_vim_build_with_lua_PKGBUILD.diff
View gist:3560df167c7ce41021bb
diff --git a/vim/PKGBUILD b/vim/PKGBUILD
index ba3e6990049c..3f45acb5a503 100644
--- a/vim/PKGBUILD
+++ b/vim/PKGBUILD
@@ -2,8 +2,8 @@
pkgname=vim
_topver=7.4
-_patchlevel=728
-__hgrev=9782a8aa2d7f
@tomoh1r
tomoh1r / mock_with_stmt.py
Created Apr 14, 2015
with 文を mock する
View mock_with_stmt.py
# -*- coding: utf-8 -*-
import mock
import contextlib
@contextlib.contextmanager
def hoge():
yield u'ハリルホジッチ'