Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
@hidsh
hidsh / emacs-test-emulate-key-input-and-exec-minibuffer.el
Last active April 5, 2023 20:30
elispでミニバッファに何か入力して実行するテスト
;; M-x ttt すると f2関数がコール
;; -> 自動でミニバッファに文字列を入力
;; -> 自動でEnter入力
;; -> 結果が表示される
(defun f2 ()
"ミニバッファに文字列を入力してEnterする。"
(insert "(1+ 5)")
(setq unread-command-events (listify-key-sequence "\C-j")) ;; Enterキー入力をエミュレート
;;(setq unread-command-events (listify-key-sequence (kbd "RET"))) ;; こっちでないとダメなときがある
@y2q-actionman
y2q-actionman / a_road_to_common_lisp_jp.md
Last active April 30, 2024 17:55
A Road to Common Lisp 翻訳

この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。

原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/


A Road to Common Lisp (Common Lisp への道)

これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。

@mono0926
mono0926 / commit_message_example.md
Last active March 29, 2024 03:40
[転載] gitにおけるコミットログ/メッセージ例文集100
@hidsh
hidsh / prim-delay-test.c
Last active October 10, 2023 03:55
Cで一次遅れフィルタ
#include <stdio.h>
typedef short s2;
s2 primary_delay(s2 in, s2 old)
{
const s2 TS = 1; // sampling period[ms]
const s2 TAU = 100; // time constant[ms]
return (TS * in + TAU * old + TAU) / (TS + TAU);
@hidsh
hidsh / gistsearch.py
Last active December 17, 2015 01:48 — forked from narusemotoki/gistsearch.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# gistsearch.py
#
from urllib import urlopen
import json
import sys
import os
@narusemotoki
narusemotoki / gistsearch.py
Last active December 14, 2015 16:19
自分のGistを検索できないらしいので、ユーザ名とdescriptionに含まれていて欲しい文字列を引数で渡すと、引っかかったGistのdescriptionとURLを出力するスクリプト書いた。 指定したユーザのGistを全て持ってきてからdescriptionの中を見ていくので遅い。しかもすぐにAPI上限に届いてしまう。 $ python gistsearch narusemotoki python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from urllib import urlopen
import json
import sys
base_url = 'https://api.github.com/users/{username}/gists?page='
def fetch(username):
def fetch(page):
@rummelonp
rummelonp / faraday.md
Last active May 20, 2022 12:23
Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた

[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた

@hidsh
hidsh / MathJax-jquery.html
Last active February 18, 2022 00:32
mathjax interactive preview
<!-- this document is fully based on MathJax-jquery.html by kurokigen. -->
<html>
<head>
<title>Live Preview of MathJax Type Setting</title>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]] } });
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
@tetu1225
tetu1225 / gist:1086001
Created July 16, 2011 04:23
RubyでHashを構造体にしてアクセサのように取得する
def Struct(hash)
# ハッシュのキーを構造体のメンバーとして設定
st = Struct.new(*hash.keys)
# 構造体に新しい要素を突っ込む
st.new(
*hash.values.map do |s|
# ハッシュの場合は再帰
Hash === s ? Struct(s) : s
end
@miyamuko
miyamuko / gist:998518
Created May 30, 2011 06:31
#xyzzy でプロセス関連の API
#|
テスト
(progn
(call-process "dir" :show :hide)
(call-process "date" :show :hide)
(get-child-processes))
;=> (#S(process-entry exe-file "dir.exe" process-id 1188 parent-process-id 4660
module-id 0 default-heap-id 0 threads 1
pri-class-base 8 usage 0 flags 0)