Skip to content

Instantly share code, notes, and snippets.

@toyowata
toyowata / gist:607b736589520d94538c
Last active November 18, 2016 16:52
Fork/Cloneしたリポジトリを本家リポジトリに追従する
$ git remote add upstream git@github.com:mbedmicro/mbed.git
$ git fetch upstream
$ git merge upstream/master
$ git push

$ git remote add xxx_work git@github.com:mbedmicro/mbed_private_xxx.git
@lierdakil
lierdakil / filter.hs
Created July 10, 2018 06:59
Pandoc filter to replace internal links with page references
import Text.Pandoc.JSON
import Data.List
main :: IO ()
main = toJSONFilter myfilter
myfilter (Link _ text (url, _))
| '#':ref <- url
= Span nullAttr $
text <>
@matsubara0507
matsubara0507 / makeSlideUsingMarkdown.md
Last active November 26, 2019 04:43
Pandoc + reveal.jsでMarkdownによるスライド作成 in Windows

Pandoc + reveal.jsでMarkdownによるスライド作成

概要

Pandoc + reveal.jsでMarkdownによるスライド作成をWindowsで行えるようにするまでの環境づくりの手順。
と、イロイロといじったのでそれをメモしておく。

いきさつ

Markdownでサクッとスライドが作れるといいなーと思って昨年ぐらいより Pandoc + reveal.js を使い始めた。
PCを新しくしたついでに環境をイロイロ整え直したので、それをメモしておこーかなと。

@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))

Lua言語入門

Hello World

コードを書く

print("hello World!!\")

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

@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 プロジェクトはごく少人数のメンテナによって活動しており、(明確な役割として定義はされていないものの) リードメンテナ、メインメンテナとして活動しています。

@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)
@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
}
@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.
@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)