Skip to content

Instantly share code, notes, and snippets.

@evanwill
evanwill / gitBash_windows.md
Last active May 13, 2024 04:59
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@hashrock
hashrock / diag.md
Last active February 26, 2024 05:51
作図系ツール・ライブラリまとめ

シーケンス図とかフローチャートをしごとで描画することになった場合、 テキストから生成できたら楽なので、それ系のツールまとめ

GraphViz

http://www.graphviz.org/

  • C製
  • Doxygen, Moinmoinなどと連携可能
  • ブロック図、クラス図、ネットワーク図など
@sonkm3
sonkm3 / Dockerfile
Created February 12, 2021 08:27
Raspberry Pi pico用のMicroPythonを手元でビルドするメモ
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake \
build-essential \
binutils-arm-none-eabi \
gcc-arm-none-eabi \
libnewlib-dev \
@AnchorBlues
AnchorBlues / dict_vs_XXX.py
Created May 19, 2021 02:34
辞書の代わりに用いることが出来るオブジェクト比較
from collections import namedtuple
from typing import NamedTuple
from dataclasses import dataclass, asdict
# Python 3.7.3 で検証
D = namedtuple('D', ('a', 'b', 'c'))
# 一部のメンバだけデフォルト値指定、というのができない? また、mypyに怒られる(正式な書き方じゃない?)。
D.__new__.__defaults__ = (1, None, 0)
@pklaus
pklaus / scpi-server.py
Last active February 21, 2023 06:03
Run an SCPI Server implemented in Python
#!/usr/bin/env python
"""
Run a multi-threaded single-client SCPI Server implemented in Python.
Using a single-client server is sensible for many SCPI servers
where state would need to be shared between the multiple clients
and thus access to it would need to be made thread-safe.
In most cases, this doesn't make sense. Everything is
simply much easier when allowing only one client at a time.
@tarleb
tarleb / interactive.lua
Last active October 21, 2022 11:02
Helper function for interactive Lua filters
function interactive (it, env)
local has_readline, RL = pcall(require, 'readline')
if not has_readline then
RL = {
readline = function (prompt)
io.stdout:write(prompt)
return io.read()
end
}
@GrantBirki
GrantBirki / tarkov-time-python.py
Created March 1, 2022 07:49
Tarkov Time in Python
from datetime import datetime
# 7 seconds for every one second in real time
TARKOV_RATIO = 7
def real_time_to_tarkov_time(time, left = True):
"""
Convert real time to Tarkov time
:param time: Current UTC epoch in milliseconds -> int(datetime.datetime.utcnow().timestamp()) * 1000
:param left: True if left side, False if right side (Think eft in-game clock)
@tk0miya
tk0miya / tk0miya-sponsors-2021.md
Last active September 23, 2021 13:25 — forked from melpon/wandbox-sponsors.md
@tk0miya のスポンサー募集

(For English readers: please read https://github.com/sponsors/tk0miya instead)

@tk0miya の企業・個人スポンサーを募集します

@tkomiya は、日本在住の OSS 開発者です。
趣味として Sphinxpycmarkblockdiag などの OSS の開発やメンテナンスに携わっています。

ここ数年の活動の中心は Sphinx です。 Sphinx は PythonLinux カーネルをはじめとして、数多くの OSS のドキュメントに利用されているドキュメンテーションツールです。 Sphinx プロジェクトはごく少人数のメンテナによって活動しており、(明確な役割として定義はされていないものの) リードメンテナ、メインメンテナとして活動しています。

Lua言語入門

Hello World

コードを書く

print("hello World!!\")

拡張子は.lua としてファイルを保存

@noahcoad
noahcoad / yaml2json.py
Last active December 27, 2019 22:46
Python to Convert yaml to json
# convert yaml to json
# pip3 install pyyaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml
# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73
import yaml, json, sys
sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2))