Skip to content

Instantly share code, notes, and snippets.

View yk-tanigawa's full-sized avatar

Yosuke Tanigawa yk-tanigawa

View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@aphlysia
aphlysia / stfuawsc_itg_advent2014_4_conda.md
Last active June 16, 2023 01:05
conda で python の環境つくり

これは stfuawsc_itg Advent Calendar 2014 4日目の記事です。

プログラミングをしていると、いろいろなバージョンの環境を行ったり来たりしたくなることがあります。たとえば言語処理は python 2 へ nltk を入れてやりたい。シミュレーションは python 3 へ numpy 入れてやりたいとか。
そういうふうに言語やモジュールのバージョンをいろいろ組合せた環境を気軽に切り替えられると便利です。
実際そういうことを可能にするツールはたくさんあります。virtualenv, pyenv など。
ここで紹介する conda というツールもその1つです。
virtualenv などでは、モジュールを入れるときは通常の python の流儀でインストールするのですが、インストールがうまくいかないというのはよくあることです。conda ではあらかじめビルドされたものを入れるので、楽です。もちろん conda に用意されていないモジュールもありますが、そういうのは pip 等通常の方法で入れて共存できます。

ではさっそく conda で python の環境を作る方法です。

@dznz
dznz / gist:64a34466f44d1a335e75
Created October 29, 2015 22:40
Extract the filename from a path in Excel or Google spreadsheet
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",100)),99))
@katowulf
katowulf / firebase_copy.js
Last active July 29, 2022 15:58
Move or copy a Firebase path to a new location
function copyFbRecord(oldRef, newRef) {
oldRef.once('value', function(snap) {
newRef.set( snap.value(), function(error) {
if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); }
});
});
}
@palexander
palexander / gist:2975305
Last active January 21, 2022 14:03
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
@bittner
bittner / gnu-tools-for-mac.sh
Last active December 11, 2021 20:05
Cross-OS compatibility with GNU tools (readlink, sed, zcat, zless, zdiff, ...) for Mac OS X towards Linux
# DESCRIPTION OF PROBLEM: Implementations of sed, readlink, zcat, etc. are different on OS X and Linux.
# NOTE: Put this on top of your script using sed, readlink, zcat, etc. that should work alike on Mac OS X.
# cross-OS compatibility (greadlink, gsed, zcat are GNU implementations for OS X)
[[ `uname` == 'Darwin' ]] && {
which greadlink gsed gzcat > /dev/null && {
unalias readlink sed zcat
alias readlink=greadlink sed=gsed zcat=gzcat
} || {
echo 'ERROR: GNU utils required for Mac. You may use homebrew to install them: brew install coreutils gnu-sed'
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
@sasaki-shigeo
sasaki-shigeo / NumericConstants.scala
Created September 15, 2012 10:11
Numeric Constants in Scala (Scala の数値定数)
Int.MaxValue // Int の最大値
Int.MinValue // Int の最小値
Long.MaxValue // Long の最大値
Long.MinValue // Long の最小値
Byte.MaxValue // Byte の最大値
Byte.MinValue // Byte の最小値
Short.MaxValue // Short の最大値
@yk-tanigawa
yk-tanigawa / jupyter-remote-login.sh
Created February 2, 2018 09:46
ssh port forwarding scripts
#!/bin/bash
# parse args
if [ $# -lt 2 ] ; then
echo "usage: $0 <target-server> <login-server> [local port (default: 18888)] [target port (default: 8888)] [login port (default: rand)]" >&2
exit 1
fi
target=$1

This script works as a wrapper for sbatch command.

Usage: sherlock-one-liner python --version