Skip to content

Instantly share code, notes, and snippets.

View kobake's full-sized avatar

KOBAYASHI Keiichi kobake

View GitHub Profile
@kobake
kobake / db-4.8.30-fix-for-mingw.patch
Created February 4, 2017 17:34
Berkeley DB 4.8.30 fixing patch for building on MinGW
diff --git a/dbreg/dbreg.c b/dbreg/dbreg.c
index 5876ce4..46473dc 100644
--- a/dbreg/dbreg.c
+++ b/dbreg/dbreg.c
@@ -680,6 +680,8 @@ __dbreg_failchk(env)
LOG *lp;
int ret, t_ret;
char buf[DB_THREADID_STRLEN];
+ db_threadid_t unused;
+ memset(&unused, 0, sizeof(unused));
@kobake
kobake / bitshift.cpp
Last active February 3, 2017 02:11
Bitwise shift operators: If the value of the right operand is negative or is greater than or equal to the width of the promoted left operand, the behavior is undefined.
#include <stdio.h>
int main() {
int n = 1;
for (int i = 0; i < 32; i++) {
n <<= 1;
}
printf("%d\n", n); // gcc: 0 msvc: 0
int m = 1;
@kobake
kobake / times.py
Created January 1, 2017 00:06
うるう秒付近の日時観測用スクリプト(特におもしろい結果は見れなかった)
import datetime
import locale
import time
while true:
t = datetime.datetime.today()
print(t)
time.sleep(0.1)
@kobake
kobake / nuget-list.txt
Created December 12, 2016 05:25
nuget パッケージ2万件分(名前検討用)
PM> Get-Package -ListAvailable -PageSize 10000
Id Versions Description
-- -------- -----------
Newtonsoft.Json {9.0.1} Json.NET is a popular high-performance JSON framework for .NET
EntityFramework {6.1.3} Entity Framework is Microsoft's recommended data access technology for new applications.
NUnit {3.5.0} NUnit is a unit-testing framework for all .NET languages with a strong TDD focus.
jQuery
@kobake
kobake / twitter-objects.txt
Last active December 10, 2016 14:48
twitter.com からひっぱってきたオブジェクト群
This file has been truncated, but you can view the full file.
window.speechSynthesis : object
window.speechSynthesis.pending : boolean
window.speechSynthesis.onvoiceschanged : object
window.speechSynthesis.speak : function
window.speechSynthesis.cancel : function
window.speechSynthesis.pause : function
window.speechSynthesis.resume : function
window.speechSynthesis.getVoices : function
window.speechSynthesis.addEventListener : function
window.speechSynthesis.removeEventListener : function
@kobake
kobake / 2ch-boards.json
Created November 30, 2016 13:44
2ch板一覧JSON
{
"http://headline.2ch.net/bbynamazu/": {
"url": "http://headline.2ch.net/bbynamazu/",
"name": "地震headline",
"unicode": null
},
"http://potato.2ch.net/namazuplus/": {
"url": "http://potato.2ch.net/namazuplus/",
"name": "地震速報",
"unicode": null
window.$ = $;
$(function(){
var LIMIT = 24; // この分数経ったら止める
setInterval(function(){
// 再生開始の監視
if(!$('.control-play-pause').find('i').hasClass('mdi-av-play-arrow')){ // 再生中
if(!parseInt(localStorage.getItem('starttime'))){
console.log("START!");
localStorage.setItem('starttime', new Date().getTime());
}
@kobake
kobake / github-date-expand-bookmarklet
Last active December 28, 2022 07:01
GitHub の「... days ago」みたいな所を日時表示に展開するブックマークレット ref: http://qiita.com/kobake@github/items/06dcc5b6135fd38adeb7
javascript:(function(){$('time').each(function(){var t = new Date($(this).attr('datetime'));var full = '';full += t.getFullYear() + '/';full += ('0' + (t.getMonth() + 1)).slice(-2) + '/';full += ('0' + t.getDate()).slice(-2) + ' ';full += ('0' + t.getHours()).slice(-2) + ':';full += ('0' + t.getMinutes()).slice(-2) + ':';full += ('0' + t.getSeconds()).slice(-2);$(this).text(full);});})();
@kobake
kobake / github-markdown-toc-bookmarklet
Last active August 29, 2015 14:23
GitHub の Markdown に TOC (目次) を付けるブックマークレット ref: http://qiita.com/kobake@github/items/3f29a0e20ae4c49e0c81
javascript:(function(){/* style */var style = (function () {/*.toc{border: 1px solid #aaa;padding: 4px 12px;margin-bottom: 12px;position: relative;padding-top: 30px;}.toc-title{display: inline-block;width: auto;background-color: #ccc;position: absolute;left: 0px;top: 0px;font-size: 8pt;padding: 2px 4px;padding-right: 8px;color: #666;}.toc-h{font-size: 11pt;}.toc-h1{}.toc-h2{margin-left: 20px;}.toc-h3{margin-left: 40px;}*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];$('.toc-style').remove();$('body').append($('<style class="toc-style">\n' + style + '\n</style>'));/* toc frame */$('.toc').remove();var $toc = $('<div class="toc"><div class="toc-title">TOC</div></div>');$toc.prependTo($('.markdown-body'));/* each links */$('.markdown-body h1, .markdown-body h2, .markdown-body h3').each(function(){/* level */var tagName = $(this).prop('tagName').toLowerCase();/* link div */var $div = $('<div class="toc-h toc-' + tagName + '"></div>');/* link */var $a = $('<a href=""></a>');$a.appendTo($div);$a.text($(this).text
@kobake
kobake / console-log-wave
Created April 25, 2015 07:40
console-log-wave
test