Skip to content

Instantly share code, notes, and snippets.

@furandon-pig
furandon-pig / brocco.c
Last active December 5, 2020 03:26
broccofsその1(FUSEサンプル)です。
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <[email protected]>
Copyright (C) 2020 furandon_pig <[email protected]>
This program can be distributed under the terms of the GNU GPLv2.
See the file COPYING.
*/
/*
@furandon-pig
furandon-pig / ByteCompareSample.java
Created February 16, 2020 22:03
Javaの文字列をbyte単位で比較するサンプルコードです。
/*
* 実行例:
* $ java Main
* s1= 日本語, length= 9
* s2= 日本語, length= 14
* oooooooooxxxxx
*/
public class Main {
public static void main(String... args) throws Exception {
// どちらもSystem.out.println()では「日本語」と表示される。
@furandon-pig
furandon-pig / advcal_list.rb
Last active November 28, 2021 18:46
アドベントカレンダーの記事一覧を取得するスクリプトです。
#!/usr/bin/env ruby
# BSD 2-Clause License
#
# Copyright (c) 2019, furandon-pig
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@furandon-pig
furandon-pig / netbsd_lua_kern_module_sample.c
Last active December 31, 2018 14:19
NetBSDのLuaカーネルモジュールサンプルです。
/*-
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
@furandon-pig
furandon-pig / hello.c
Created December 16, 2018 10:02
Linux-4.19.9でのカーネルモジュール作成サンプル。
/*
* hello.c - kernel module sample with sysctl value
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/seq_file.h>
static struct ctl_table_header *hello_sysctl_header;
@furandon-pig
furandon-pig / datefs.c
Created December 15, 2018 14:18
NetBSDのpuffsでlsしたときに今日の日付を返すサンプルです。
/* $NetBSD: datefs.c,v 1.18 2008/11/26 14:03:48 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@furandon-pig
furandon-pig / netbsd_sysctl_sample.c
Created December 12, 2018 18:32
NetBSDカーネルモジュールでsysctlを実装するサンプルです。
/* $NetBSD: hello.c,v 1.1 2015/05/13 07:07:36 pgoyette Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@furandon-pig
furandon-pig / arduboy-for-pc_build_ubuntu.diff
Created August 30, 2017 03:52
Diff file for build "arduboy-for-pc" on the Ubuntu
diff --git a/emulate/emulate.h b/emulate/emulate.h
index d9a593c..279fa5e 100644
--- a/emulate/emulate.h
+++ b/emulate/emulate.h
@@ -6,6 +6,15 @@
#include <stdbool.h>
#include <time.h>
@furandon-pig
furandon-pig / get_nbsd_kernsrc.sh
Last active February 26, 2017 05:34
NetBSDのソースコードを取得するシェルスクリプトです。
#!/bin/sh
# example)
# ${BASE_URL}/NetBSD-7.0/${SRC_DIR}
BASE_URL=http://ftp.jaist.ac.jp/pub/NetBSD/
SRC_DIR=source/sets/
TEMP_DIR=${HOME}/.nbsd_kernsrc_list
KERNSRC_LIST_HTML=${TEMP_DIR}/kernsrc_list.html
KERNSRC_LIST=${TEMP_DIR}/kernsrc_list.txt
@furandon-pig
furandon-pig / officeui_panel_helper.js
Created December 12, 2015 13:02
Office UI Fabric Advent Calendar 2015用のパネルのサンプルプログラムで使用しているヘルパスクリプトです。
/*
* Office UI Fabric Advent Calendar 2015用のパネルの
* サンプルプログラムで使用しているヘルパスクリプト
*
* 以下のサンプルプログラム(MIT License)のJSコードをサンプル用に一部
* 修正しています。
* Panel
* http://dev.office.com/fabric/components/panel
*/