Skip to content

Instantly share code, notes, and snippets.

View hnishi's full-sized avatar
🏠
Working from home

hnishi hnishi

🏠
Working from home
View GitHub Profile
@kat0h
kat0h / vim9script4pythondevelopers.md
Last active March 31, 2021 07:51
Vim9 script for Python Developers

Vim9 script for Python Developers

Vim9 scriptはVim scriptとの互換をなくし変数の型縛りを導入したり、コンパイルをすることなどにより、高速化を実現した新しい処理系です。

defコマンドで定義された関数内、またはVim script内でvim9scriptコマンドを使うことで利用できます(vim9scriptコマンドの後ではfunctionコマンドは利用できません)。

この記事は、 https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0 の内容を元にVim(v8.2.2576)上のVim9 scriptで動作するように改変したものです。

Vim9 scriptで動作を確認できなかったもの、まだ実装されていなものはpassと表記し、省略しています。

@ikeyasu
ikeyasu / pfrl_train_rainbow_mario.py
Created January 17, 2021 13:51
pfrl_train_rainbow_mario.py
import argparse
import json
import os
import gym
import numpy as np
import torch
import pfrl
from pfrl import agents, experiments, explorers
@steven2358
steven2358 / ffmpeg.md
Last active May 1, 2024 23:11
FFmpeg cheat sheet
@jtpio
jtpio / app.py
Created January 24, 2018 23:17
Dash URL State example
import dash
import dash_core_components as dcc
import dash_html_components as html
from urllib.parse import urlparse, parse_qsl, urlencode
from dash.dependencies import Input, Output
app = dash.Dash()
app.config.suppress_callback_exceptions = True
@mattmc3
mattmc3 / import_xml_to_dataframe_to_sql.py
Created January 8, 2018 15:53
Python: Import XML to Pandas dataframe, and then dataframe to Sqlite database
import xml.etree.ElementTree as ET
import pandas as pd
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
# do this if running in jupyter
# pd.set_option('display.max_columns', None)
# convert XML to dataframe (assumes only one layer of nesting)
def xml2df(xml_data):
@comefigo
comefigo / crawler.md
Created December 25, 2017 02:18
crawler

クローラ調査

クローラにクローリングしないように指示するための方法

クローラ対策の検証手順

  1. インターネット公開できるWebサーバを用意する
  2. Webサーバに簡単なhtmlファイルを配置する
    htmlファイルには
@kaityo256
kaityo256 / howto.md
Last active April 2, 2024 14:43
研究者として生きていくコツ

研究者として生きていくコツ

これは卜部さんの優秀なプログラマーになるためのコツに影響されて書いたものです。

著者について

自分を構成する要素は、大きい順にシステムエンジニア、プログラマ、研究者だと思っています。でも、おそらく給料は「研究者」として払われているため、研究者として生きていくコツとしました。僕はさほど優秀とは言えませんが、とりあえずそれなりに長いことそれで食っています。大学の教授のウェブサイトに「研究者としてのコツ」みたいなことが書いてあることがありますが、これには「既に大学の教授になっている人が書いている」という強烈なバイアスがかかっています。もちろん参考になることも書いてありますが、「死ぬほど研究しろ、研究のことだけ考えろ」的な文章が多い印象です。これは普通の人にとって役に立たない助言です。これは平均的な研究者として生きていくための戯言、ポエムだと思ってください。

健康第一

@shyouhei
shyouhei / gist:266178ffedab5767a5b69b972c76f88a
Created September 27, 2017 07:31
優秀なプログラマーになるためのコツ

優秀なプログラマーになるためのコツ

重要な順で

優秀なプログラマーになるには非常に長い時間がかかるという現実を直視すべし

優秀なプログラマーというのは寝ている間に異世界に召喚されて無双するのとはわけが違うんですよ。

自分の例で言うとプログラミングを始めた中学生の時から優秀なプログラマだったかって、そんなわけない。みんなヘッポコからスタートしているに決まってるわけです。以来二十余年、地道に生き恥を晒し続けてきた結果として、現在いちおう業界の末席を汚すところまで来ている。このプロセスから目を背けるべきではないです。優秀なプログラマーに生まれる人間なんかいない。優秀なプログラマーに「育つ」んだし、それには時間が必要。今日から無双したいと思うな。

@utahka
utahka / df_append.py
Created September 18, 2017 07:32
空のデータフレームを作って、レコードを追加していくパターン
import pandas as pd
cols = ['col1', 'col2']
df = pd.DataFrame(index=[], columns=cols)
record = pd.Series(['hoge', 'fuga'], index=df.columns)
for _ in range(5):
df = df.append(record, ignore_index=True)
@mono0926
mono0926 / LICENSE
Last active August 8, 2021 12:31
This license applies to all public gists https://gist.github.com/mono0926
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit