Skip to content

Instantly share code, notes, and snippets.

View keichi's full-sized avatar

Keichi Takahashi keichi

View GitHub Profile
@llj098
llj098 / Makefile
Created December 23, 2010 01:36
a sample tcp server runs in kernel
obj-m += tcp_svr_sample.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clea
@banthar
banthar / stack_trace.c
Created November 7, 2011 01:41
stacktrace with libunwind and elfutils
// stack_trace.c
//
// gcc stack_trace.c -ldw -lunwind -g -o stack_trace
#define UNW_LOCAL_ONLY
#include <elfutils/libdwfl.h>
#include <libunwind.h>
#include <stdio.h>
@mre
mre / bitonic_sort.cu
Last active May 16, 2024 16:41
Bitonic Sort on CUDA. On a quick benchmark it was 10x faster than the CPU version.
/*
* Parallel bitonic sort using CUDA.
* Compile with
* nvcc -arch=sm_11 bitonic_sort.cu
* Based on http://www.tools-of-computing.com/tc/CS/Sorts/bitonic_sort.htm
* License: BSD 3
*/
#include <stdlib.h>
#include <stdio.h>
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@mala
mala / gist:4683033
Created January 31, 2013 13:57
UPnPの設定変更をFlashから行うやつって今でも出来んのかという話
http://www.gnucitizen.org/blog/hacking-the-interwebs/ や、この問題を取り上げてるブログ記事なんかで
Flashの仕様じゃー、とかバージョンアップしても直らないみたいなこと書かれてるのですが、
少なくとも現状、Flashで独自のリクエストヘッダ追加した上でのクロスドメインのPOSTリクエストはcrossdomain.xmlを要求するようになっています。
Flashの仕様なんでバージョンアップしても解消しないんだぜー、って書かれたままの記事が多くあるため
「えっ、そうなの?」という印象を受けてしまった。
この記事が書かれた頃には出来たようだけど、JavaScript使いからするとこの挙動は直感に反するもので、
Flashを使うことで「ユーザーの許可無く」「ブラウザ標準の機能で出来ること以上のことが出来ている」のがおかしい。
@kaishuu0123
kaishuu0123 / xv6.md
Last active April 23, 2022 15:56
xv6 を読む
@jedisct1
jedisct1 / tweetnacl-indented.c
Last active November 12, 2022 18:02
Indented version of @TweetNacl
#include "tweetnacl.h"
#define FOR(i,n) for (i = 0;i < n;++i)
#define sv static void
typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef long long i64;
typedef i64 gf[16];
@schacon
schacon / git-http-proto.txt
Created July 26, 2013 22:16
Git HTTP transport protocol documentation
HTTP transfer protocols
=======================
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
connection, and a "smart" protocol which requires a Git aware CGI
(or server module). This document describes both protocols.
As a design feature smart clients can automatically upgrade "dumb"
protocol URLs to smart URLs. This permits all users to have the
@nakaji-s
nakaji-s / gist:7969970
Last active August 31, 2020 02:02
Goと依存パッケージ管理

このgistは Cloud Foundry Advent Calendar 2013 の16日目の記事です。

はじめに

現在、CloudFoundryのComponentsはGo化しつつあります。それにより、Rubyで実装されていたものに対して性能向上していたり、ソースが読みやすくなっていたりする(こちらは主観ですが・・)半面、開発者にとっての課題も生まれています。その課題のひとつが__依存パッケージ管理__です。まずはRubyの外部パッケージ管理について簡単に振り返りつつ、Goのそれを見ていこうと思います。

依存パッケージ管理(Ruby)

Rubyでは外部パッケージはGemファイルとなっており、大抵の場合、Bundlerで管理します。また、最新版が動くとは限らないため設定ファイルにバージョンを指定してそれを使用します。Gemファイル自体はRubyGems.orgに置かれており、ここからダウンロードされます。

依存パッケージ管理(Go)

Goではソースコード中のimport句でパッケージを指定します。設定ファイルは使いません。以下に例を示します。

@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant