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 / prompt.zsh
Last active December 14, 2015 03:09
PROMPT vcs_info
autoload -Uz vcs_info
zstyle ':vcs_info:*' formats '(%s)-[%b]'
zstyle ':vcs_info:*' actionformats '(%s)-[%b|%a]'
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
autoload -Uz is-at-least
if is-at-least 4.3.10; then
@cosmo0920
cosmo0920 / gist:4750143
Created February 10, 2013 16:37
emerge -uvp worldしたらprefixのプロファイルは古いよーとか言われてしまって白目
% emerge -uvp world
!!! Your current profile is deprecated and not supported anymore.
!!! Use eselect profile to update your profile.
!!! Please upgrade to the following profile if possible:
default/linux/amd64/13.0/no-multilib
@cosmo0920
cosmo0920 / fix-linux-3_7_VMWare.sh
Created January 25, 2013 17:15
VMWare player 5.0.1がLinuxカーネル3.7のversion.hを探してくれなくてつらぽよだった
#!/usr/bin/env sh
HEAEDERSROOT=/lib/modules/`uname -r`/build
sudo ln -s ${HEAEDERSROOT}/include/generated/uapi/linux/version.h ${HEAEDERSROOT}/include/linux/version.h
@cosmo0920
cosmo0920 / kernel_version.el
Created January 22, 2013 23:28
カーネルのバージョンを取ってくるELisp
(defun kernel-version()(replace-regexp-in-string "\n+$" "" (shell-command-to-string "uname -r")))
(message "kernel version is %s" (kernel-version))
--- llvm-9999/docs/Makefile.sphinx 2012-12-31 05:16:20.630466221 +0900
+++ llvm-9999/docs/Makefile.sphinx.edited 2012-12-31 05:15:41.410467184 +0900
@@ -3,7 +3,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
-SPHINXBUILD = sphinx-build
+SPHINXBUILD = sphinx-build-2.7
PAPER =
BUILDDIR = _build
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Parallel.OpenCL
import Foreign( castPtr, nullPtr, sizeOf )
import Foreign.C.Types( CFloat,CDouble )
import Foreign.Marshal.Array( newArray, peekArray )
import System.IO
import System.Exit
import qualified Control.Exception as E
import Control.Monad
import Data.List
@cosmo0920
cosmo0920 / fay-jquery-9999.ebuild
Created November 24, 2012 23:16
fay-jquery ebuild
# Copyright 2012 cosmo
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
# ebuild generated by cosmo
CABAL_FEATURES="lib profile haddock hoogle hscolour"
inherit haskell-cabal git-2
@cosmo0920
cosmo0920 / redirect.hs
Created November 24, 2012 22:39
fay langを使ってRedirect
$ fay --no-ghc redirect.hs --html-wrapper
@cosmo0920
cosmo0920 / switch_ghci.el
Created October 5, 2012 22:56
Prefixのghciとシステムのghciを切り替える
;; Prefixのghciとシステムのghciを切り替える
(when (locate-library "haskell-mode")
(global-set-key "\C-\M-h"
(lambda () (interactive)
(setq haskell-program-name "~/gentoo/usr/bin/ghci")
(message "ghci change to ~/gentoo/usr/bin/ghci")))
(global-set-key "\C-\M-c"
(lambda () (interactive)
(setq haskell-program-name "/usr/bin/ghci")
(message "ghci change to /usr/bin/ghci"))))
@cosmo0920
cosmo0920 / diff_show_twit_message.patch
Created October 1, 2012 21:54
show_faceを使って何処のツイートを指しているかを見てみる
--- nested_quote.rb.orig 2012-10-02 00:24:24.000000000 +0900
+++ nested_quote.rb 2012-10-02 06:51:49.000000000 +0900
@@ -179,6 +179,13 @@
Plugin.create :nested_quote do
command(:copy_tweet_url,
name: 'ツイートのURLをコピー',
+ show_face: Proc.new{ |m|
+ whotwi = m.messages.first.message.idname
+ if m.messages.first.message.to_s.length > 20 then
+ show_message = m.messages.first.message.to_s[0, 20] + "..."