Skip to content

Instantly share code, notes, and snippets.

View tomoh1r's full-sized avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

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

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 December 11, 2016 04:32
Fluentd + Elasticsearch + Kibana and send local journald logs.

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 December 25, 2015 03:51
angular simple example
<!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 December 21, 2015 14:04
ES5 のオブジェクトテスト
> function Some() { this.say = say; return this; function say(msg) { console.log(msg); } }
undefined
> Some().say('あいうえお');
あいうえお
undefined
@tomoh1r
tomoh1r / some.py
Created November 23, 2015 13:04
decorator でラップされた対象を控えておく
>>> 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 October 27, 2015 12:56
インデントとかはこちらのほうがすき
(defun fact (n &optional m) (
if (zerop n)
m
(fact (1- n) (if m (* m n) n))
))
@tomoh1r
tomoh1r / result.txt
Created August 13, 2015 01:19
Python で辞書を作る
>>> 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 August 29, 2015 14:25
15個 fizz/buzz のリスト作ってから yield で fizzbuzz
#! /usr/bin/env python
# -*- coding: utf-8 -*-
def fizzbuzz():
loop = [
None,
None,
'fizz',
None,
@tomoh1r
tomoh1r / gist:3560df167c7ce41021bb
Last active August 29, 2015 14:23
msys2_vim_build_with_lua_PKGBUILD.diff
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 April 14, 2015 13:58
with 文を mock する
# -*- coding: utf-8 -*-
import mock
import contextlib
@contextlib.contextmanager
def hoge():
yield u'ハリルホジッチ'