Skip to content

Instantly share code, notes, and snippets.

View cosmo0920's full-sized avatar
🏠
Working from home

Hiroshi Hatake cosmo0920

🏠
Working from home
View GitHub Profile
@cosmo0920
cosmo0920 / gist:2707880
Created May 16, 2012 05:57
clang3 -v -x c++ /dev/null -fsyntax-only
$ clang3 -v -x c++ /dev/null -fsyntax-only
clang version 3.1 (trunk 152121)
Target: i386-pc-linux-gnu
Thread model: posix
"/home/cosmo/llvm/bin/clang" -cc1 -triple i386-pc-linux-gnu -fsyntax-only -disable-free -main-file-name null -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v -resource-dir /home/cosmo/llvm/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -I /opt/intel/composerxe-2011.5.220/mkl/include -I /opt/intel/composerxe-2011.5.220/tbb/include -internal-isystem /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6/i686-linux-gnu -internal-isystem /usr/lib/gcc/i686-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /home/cosmo/llvm/bin/../lib/clang/3.1/include -internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem /include -internal-externc-
@cosmo0920
cosmo0920 / glib_prefix_build.log
Created May 23, 2012 10:30
dev-libs/glibのemergeに失敗する…
* IMPORTANT: 3 news items need reading for repository 'gentoo_prefix'.
* Use eselect news to read news items.
These are the packages that would be merged, in order:
Calculating dependencies ...... done!
[ebuild U ] dev-libs/gobject-introspection-1.32.1 [1.30.0-r2] USE="-doc -doctool% -test" 0 kB
[ebuild U ] x11-libs/gtk+-3.4.3 [3.2.4-r1] USE="X%* introspection (-aqua) -colord (-cups) -debug -doc -examples (-packagekit) -test -vim-syntax (-wayland) -xinerama" 0 kB
@cosmo0920
cosmo0920 / emacs.el
Created May 28, 2012 16:14
Vimmerに嬉しいauto-complete-mode-hook
(add-hook 'auto-complete-mode-hook
(lambda ()
(define-key ac-completing-map (kbd "C-n") 'ac-next)
(define-key ac-completing-map (kbd "C-p") 'ac-previous)))
@cosmo0920
cosmo0920 / regexg.cpp
Created May 30, 2012 14:35
C++で正規表現使ってファイルの中からgrepしよう。出典:http://itpro.nikkeibp.co.jp/article/COLUMN/20071024/285414/?ST=oss&P=3
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <boost/regex.hpp>
//このファイルの情報を元に検索を行う
const char filename[] = "filename.txt";
//出力をする関数たち
template <typename T>
@cosmo0920
cosmo0920 / zshrc_part.zsh
Created June 16, 2012 19:50
使い慣れている表示っぽくなったヾ(@⌒ー⌒@)ノ
setopt prompt_subst
## プロンプトの設定
autoload colors
colors
PROMPT="%n@`hostname -s`:%~%%"
PROMPT2='>> '
if [ "$TERM" = "xterm" -o "$TERM" = "kterm" ]
then
hostname=`hostname -s`
@cosmo0920
cosmo0920 / ghc-7.4.1-r1.patch
Created June 24, 2012 13:12
USE=binaryが通らなかったのでパッチを書いてみた
--- /home/cosmo/Gentoo/var/lib/layman/haskell/dev-lang/ghc/ghc-7.4.1-r1.ebuild 2012-06-24 21:15:42.299455127 +0900
+++ /home/cosmo/overlay/cosmo-betalab/dev-lang/ghc/ghc-7.4.1-r1.ebuild 2012-06-25 05:46:08.615946259 +0900
@@ -209,13 +209,22 @@
cp "${WORKDIR}/usr/bin/ghc-pkg-${PV}" "$gp_back" || die "unable to backup ghc-pkg wrapper"
# Relocate from /usr to ${EPREFIX}/usr
- relocate_path "/usr" "${to}/usr" \
+ if [ -d "${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"];
+ then
+ relocate_path "/usr" "${to}/usr" \
@cosmo0920
cosmo0920 / kteiden_json.rb
Created July 2, 2012 15:21
上手いパース方法ないかなぁ
#!/usr/bin/env ruby -Ku
require "open-uri"
require "rubygems"
require "json"
require "time"
src = ''
group = "1-A"
begin
open("http://kteiden.chibiegg.net/api/kteiden.json?&group=#{group}"){|file|
@cosmo0920
cosmo0920 / teiden_kansai.rb
Created July 2, 2012 16:16
非公式関電APIのmikutterプラグインのプロトタイプ。
#!/usr/bin/env ruby -Ku
# -*- coding: utf-8 -*-
require "open-uri"
require "rubygems"
require "json"
require "time"
Plugin.create :teiden_kansai do
src = ''
group = "4-F"
begin
@cosmo0920
cosmo0920 / teiden_kansai.rb
Created July 2, 2012 20:32
非公式関電APIのmikutterプラグインのプロトタイプ。
#!/usr/bin/env ruby -Ku
# -*- coding: utf-8 -*-
require "open-uri"
require "rubygems"
require "json"
require "time"
def notifymsg(msg)
#jsonパーサーを使う
json = JSON.parser.new(msg)
@cosmo0920
cosmo0920 / conform_destroy_dev_vmm.patch
Created July 30, 2012 04:17
/dev/vmmが存在した時にvmmctl --destroyするとホストがカーネルパニックを起こすのでそれをvmmctlから食い止める:コンパイルを通るようにした
--- vmmctl.c.orig 2012-05-03 14:04:37.000000000 +0900
+++ vmmctl.c 2012-08-08 00:31:25.291915647 +0900
@@ -47,6 +47,8 @@
#include <machine/vmm.h>
#include <vmmapi.h>
+#include <dirent.h>
+#include <ctype.h>
#include "intel/vmcs.h"