Skip to content

Instantly share code, notes, and snippets.

@doloopwhile
doloopwhile / gist:5746349
Last active December 18, 2015 07:28
CentOS 5.6にrpmforgeを追加する
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
@doloopwhile
doloopwhile / gist:5946369
Created July 8, 2013 05:15
Git での diff, マージに meld を使う - わからん
Gitでのdiff, マージにmeldを使う
Git での diff, マージに meld を使う - わからん <http://d.hatena.ne.jp/kitokitoki/20121102/p1>
#! -*- coding: utf-8 -*-
'''
Problem:
The input is a sequence of digits consistent of 0-9.
We define "increasing subsequence", when the substring consists of
consecutive numbers (NOT including equal). For instance, 0369, 3478, 58.
Please write a program (using C, Java, PHP, Ruby or Python)
to find the longest increasing subsequence of numbers in the given
string.
@doloopwhile
doloopwhile / gist:6150601
Last active December 20, 2015 14:59
〇〇によるワンライナー7つ
  1. 要素を取り出してフォーマットする(sed)

入力:

# 言語名 コマンド名 バージョン番号
echo -e "\
Perl\tperl\t5.14.2
Python\tpython\t2.7.3
Ruby\truby\t1.9.3p194
@doloopwhile
doloopwhile / gist:6571087
Last active December 23, 2015 03:09
Install setuptools and pip after venv
#!/bin/bash
python3.3 -m venv myenv # `myenv` ディレクトリに仮想環境を作る
source myenv/bin/activate # `myenv` 環境を使う
# setuptoolsのインストール
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
# pipのインストール
easy_install pip
@doloopwhile
doloopwhile / gist:6571363
Created September 15, 2013 14:44
Install pip with venv
#!/bin/bash
python3.3 -m venv myenv # create virtual environment in `myenv` directory
source myenv/bin/activate # use `myenv` environment
# install setuptools
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
# install pip
easy_install pip
@doloopwhile
doloopwhile / qqimageviewer.py
Created September 29, 2013 13:21
Damn ImageViewer by PyQt5 and QtQuick.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from os.path import (
join,
dirname,
)
from PyQt5.QtCore import QUrl
@doloopwhile
doloopwhile / gist:5544ca551547a5526071
Created June 5, 2014 05:39
ltsv with method chaining
package main
type Pair struct {
Key string
Value string
}
type LTSV struct {
values []Pair
}
@doloopwhile
doloopwhile / gist:d14dca96a3b5bcf3c5eb
Last active August 29, 2015 14:02
My vim build script for Xubuntu 14.04
hg checkout v7-3-367
sudo apt-get install -y \
mercurial \
gettext \
libncurses5-dev \
libgtk2-dev \
libxt-dev
@doloopwhile
doloopwhile / git-fixup-peco
Last active July 14, 2023 06:43
git-fixup-peco: select fixup target with peco
#!/bin/bash
set -o pipefail
set -e
HASH=$(git log --oneline | peco | cut -d " " -f 1)
if [ "$?" -ne 0 -o -z "$HASH" ]; then
exit 1
fi
git commit --fixup "$HASH" $@
# install: