Skip to content

Instantly share code, notes, and snippets.

@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
#!/bin/sh
set -e
ssh='ssh'
ec2din="ec2-describe-instances"
while [ $# -gt 0 ]; do
case $1 in
-*)
if [ -z "$2" ]; then
break
@TotallyGatsby
TotallyGatsby / gitignore Unity
Created June 18, 2012 06:15
Unity .gitignore file
#This is the git ignore file used in Duck Hunted
#Note that ! negates an ignore. We ignore everything in Library then
#un-ignore the metadata folder and some specific files
#Use at your own risk, this may totally destroy your project, but it worked for us
#NOTE: this will cause your collaborators to re-import assets periodically
Temp/*
Library/*
Build/*
@repeatedly
repeatedly / d_master.md
Last active June 8, 2023 06:20
D言語基礎文法最速マスター

他の言語をある程度知っている人はこれを読めばD言語の基礎をマスターでき,D言語の氷山の一角くらいは知ることができると思います.対象バージョンはdmd 2.059です.

1. 基礎

ソースファイル

ASCIIかUTFしか受け付けません.それ以外の文字コードで書くとコンパイルエラーになります.

main

D言語のmainはCとは違い以下のようなシグネチャです.

@agramfort
agramfort / ranking.py
Created March 18, 2012 13:10 — forked from fabianp/ranking.py
Pairwise ranking using scikit-learn LinearSVC
"""
Implementation of pairwise ranking using scikit-learn LinearSVC
Reference: "Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich,
T. Graepel, K. Obermayer.
Authors: Fabian Pedregosa <fabian@fseoane.net>
Alexandre Gramfort <alexandre.gramfort@inria.fr>
"""
@mduheaume
mduheaume / .gitignore
Created January 28, 2012 17:12
Git ignore file for unity projects
Temp/
Library/
obj/
*.svd
!Library/*.asset
!Library/AssetImportState
!Library/AssetVersioning.db
!Library/BuildPlayer.prefs
!Library/ScriptMapper