3b3fba62fdbb

More.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 12 Feb 2013 11:11:48 -0500
parents dd36dd0400e5
children decdb5dbce23
branches/tags (none)
files .hgsubstate bin/lein dotcss/okcupid.com.css fish/config.fish gitconfig vim/vimrc

Changes

--- a/.hgsubstate	Thu Jan 24 23:53:17 2013 -0500
+++ b/.hgsubstate	Tue Feb 12 11:11:48 2013 -0500
@@ -23,7 +23,7 @@
 7eb00bb460f91dcb347b23198dff343b4d8e92a9 vim/bundle/slimv
 78ab4b3df24fa2753d3dfc1be75ed5a3df1565b8 vim/bundle/smartinput
 c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
-e31bbce52b3fb080a9aa88fd92dd19dab0331de8 vim/bundle/splice
+01e68795c7a14b97ec2ebbd70b0fcb42d1adac61 vim/bundle/splice
 6eec2c131213850ed65fd6da494dfd1a0d620a4e vim/bundle/strftimedammit
 7ee7f774dd1288ea2e7c57b63cb069a07d425ca0 vim/bundle/supertab
 1a73f607f8f5477d6942df2eb6e7245c4864f4d3 vim/bundle/surround
--- a/bin/lein	Thu Jan 24 23:53:17 2013 -0500
+++ b/bin/lein	Tue Feb 12 11:11:48 2013 -0500
@@ -4,13 +4,39 @@
 # somewhere on your $PATH, like ~/bin. The rest of Leiningen will be
 # installed upon first run into the ~/.lein/self-installs directory.
 
-export LEIN_VERSION="2.0.0-preview10"
+export LEIN_VERSION="2.0.0"
 
 case $LEIN_VERSION in
     *SNAPSHOT) SNAPSHOT="YES" ;;
     *) SNAPSHOT="NO" ;;
 esac
 
+if [[ "$OSTYPE" == "cygwin" ]]; then
+    delimiter=";"
+else
+    delimiter=":"
+fi
+
+function make_native_path {
+    # ensure we have native paths
+    if [[ "$OSTYPE" == "cygwin" && "$1"  == /* ]]; then
+    echo -n "$(cygpath -wp "$1")"
+    else
+    echo -n "$1"
+    fi
+}
+
+#  usage : add_path PATH_VAR [PATH]...
+function add_path {
+    local path_var="$1"
+    shift
+    while [ -n "$1" ];do
+        # http://bashify.com/?Useful_Techniques:Indirect_Variables:Indirect_Assignment
+    export ${path_var}="${!path_var}${delimiter}$(make_native_path "$1")"
+    shift
+    done
+}
+
 if [ `id -u` -eq 0 ] && [ "$LEIN_ROOT" = "" ]; then
     echo "WARNING: You're currently running as root; probably by accident."
     echo "Press control-C to abort or Enter to continue as root."
@@ -29,16 +55,16 @@
     fi
 done
 
-export LEIN_HOME=${LEIN_HOME:-"$HOME/.lein"}
+export LEIN_HOME="${LEIN_HOME:-"$HOME/.lein"}"
 
 for f in "$LEIN_HOME/leinrc" ".leinrc"; do
-  if [ -e $f ]; then
-    source $f
+  if [ -e "$f" ]; then
+    source "$f"
   fi
 done
 
 if [ "$OSTYPE" = "cygwin" ]; then
-    export LEIN_HOME=`cygpath -w $LEIN_HOME`
+    export LEIN_HOME=`cygpath -w "$LEIN_HOME"`
 fi
 
 LEIN_JAR="$LEIN_HOME/self-installs/leiningen-$LEIN_VERSION-standalone.jar"
@@ -65,16 +91,16 @@
 
 # Try to make the default more sane for :eval-in :classloader.lein
 grep -E -q '^\s*:eval-in\s+:classloader\s*$' project.clj 2> /dev/null &&
-LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-'-Xms64m -Xmx512m'}
+LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-"-Xms64m -Xmx512m"}"
 
 if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
     # Running from source checkout
     LEIN_DIR="$(dirname "$BIN_DIR")"
 
     # Need to use lein 1.x to bootstrap the leiningen-core library (for aether)
-    if [ "$(ls $LEIN_DIR/leiningen-core/lib/*)" = "" ]; then
+    if [ "$(ls "$LEIN_DIR"/leiningen-core/lib/*)" = "" ]; then
         echo "Leiningen is missing its dependencies."
-        echo "Please see \"Building\" in the README."
+        echo "Please see \"Building\" in CONTRIBUTING.md."
         exit 1
     fi
 
@@ -95,35 +121,25 @@
         cd "$LEIN_DIR"
 
         $0 classpath .lein-classpath
-        sum $LEIN_DIR/project.clj $LEIN_DIR/leiningen-core/project.clj > \
+        sum "$LEIN_DIR/project.clj" "$LEIN_DIR/leiningen-core/project.clj" > \
             .lein-project-checksum
         cd "$ORIG_PWD"
     fi
 
     mkdir -p "$LEIN_DIR/target/classes"
-    export LEIN_JVM_OPTS="${LEIN_JVM_OPTS:--Xms64m -Xmx256m} -Dclojure.compile.path=$LEIN_DIR/target/classes"
+    export LEIN_JVM_OPTS="${LEIN_JVM_OPTS:-"-Xms64m -Xmx256m"} -Dclojure.compile.path=$LEIN_DIR/target/classes"
+    add_path CLASSPATH "$LEIN_DIR/leiningen-core/src/" "$LEIN_DIR/leiningen-core/resources/" \
+                          "$LEIN_DIR/test:$LEIN_DIR/target/classes" "$LEIN_DIR/src" ":$LEIN_DIR/resources"
 
-    CLASSPATH="$LEIN_DIR/leiningen-core/src/"
-    CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/resources/"
     if [ -r "$LEIN_DIR/.lein-classpath" ]; then
-        CLASSPATH="$CLASSPATH:$(cat $LEIN_DIR/.lein-classpath 2> /dev/null)"
+        add_path CLASSPATH "$(cat "$LEIN_DIR/.lein-classpath" 2> /dev/null)"
     else
-        CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/lib/*"
-    fi
-    CLASSPATH="$CLASSPATH:$LEIN_DIR/test:$LEIN_DIR/target/classes"
-    CLASSPATH="$CLASSPATH:$LEIN_DIR/src:$LEIN_DIR/resources:$LEIN_JAR"
-    if [ -f .lein-classpath ]; then
-        CLASSPATH="`cat .lein-classpath`:$CLASSPATH"
+        add_path CLASSPATH "$LEIN_DIR/leiningen-core/lib/*"
     fi
 else # Not running from a checkout
-    # apply context specific CLASSPATH entries
-    if [ -f .lein-classpath ]; then
-        CLASSPATH="`cat .lein-classpath`:$LEIN_JAR"
-    else
-        CLASSPATH="$LEIN_JAR"
-    fi
+    add_path CLASSPATH "$LEIN_JAR"
 
-    export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Xbootclasspath/a:$LEIN_JAR"}
+    BOOTCLASSPATH="-Xbootclasspath/a:$LEIN_JAR"
 
     if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
         "$0" self-install
@@ -152,8 +168,12 @@
 }
 
 # TODO: explain what to do when Java is missing
-export JAVA_CMD=${JAVA_CMD:-"java"}
-export LEIN_JAVA_CMD=${LEIN_JAVA_CMD:-$JAVA_CMD}
+export JAVA_CMD="${JAVA_CMD:-"java"}"
+export LEIN_JAVA_CMD="${LEIN_JAVA_CMD:-$JAVA_CMD}"
+
+if [[ "$(basename "$LEIN_JAVA_CMD")" == *drip* ]]; then
+    export DRIP_INIT="$(printf -- '-e\n(require (quote leiningen.repl))')"
+fi
 
 # Support $JAVA_OPTS for backwards-compatibility.
 export JVM_OPTS="${JVM_OPTS:-"$JAVA_OPTS"}"
@@ -167,10 +187,9 @@
       echo "If you wish to re-download, delete it and rerun \"$0 self-install\"."
       exit 1
     fi
-    echo "Downloading Leiningen now..."
-    LEIN_DIR=`dirname "$LEIN_JAR"`
-    mkdir -p "$LEIN_DIR"
-    LEIN_URL="https://github.com/downloads/technomancy/leiningen/leiningen-$LEIN_VERSION-standalone.jar"
+    echo "Downloading Leiningen to $LEIN_JAR now..."
+    mkdir -p "$(dirname "$LEIN_JAR")"
+    LEIN_URL="https://leiningen.s3.amazonaws.com/downloads/leiningen-$LEIN_VERSION-standalone.jar"
     $HTTP_CLIENT "$LEIN_JAR.pending" "$LEIN_URL"
     if [ $? == 0 ]; then
         # TODO: checksum
@@ -197,7 +216,8 @@
         echo "You do not have permission to upgrade the installation in $SCRIPT"
         exit 1
     else
-        TARGET_VERSION="${2:-"preview"}"
+        # TODO: change to stable when 2.0.0 is released
+        TARGET_VERSION="${2:-preview}"
         echo "The script at $SCRIPT will be upgraded to the latest $TARGET_VERSION version."
         echo -n "Do you want to continue [Y/n]? "
         read RESP
@@ -229,21 +249,26 @@
     if [ "$OSTYPE" = "cygwin" ]; then
         # When running on Cygwin, use Windows-style paths for java
         ORIGINAL_PWD=`cygpath -w "$ORIGINAL_PWD"`
-        CLASSPATH=`cygpath -wp "$CLASSPATH"`
+    fi
+
+    # apply context specific CLASSPATH entries
+    if [ -f .lein-classpath ]; then
+        add_path CLASSPATH "$(cat .lein-classpath)"
     fi
 
     if [ $DEBUG ]; then
         echo "Leiningen's classpath: $CLASSPATH"
     fi
 
-    if [ "$LEIN_FAST_TRAMPOLINE" = "" ] && [ ! -r .lein-fast-trampoline ]; then
-        TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
-        trap "rm -f $TRAMPOLINE_FILE" EXIT
-    else
-        INPUTS="$@ $(cat project.clj) $(cat $LEIN_HOME/profiles.clj)"
+    if ([ "$LEIN_FAST_TRAMPOLINE" != "" ] || [ -r .lein-fast-trampoline ]) &&
+        [ -r project.clj ]; then
+        INPUTS="$@ $(cat project.clj) $(cat "$LEIN_HOME/profiles.clj")"
         INPUT_CHECKSUM=$(echo $INPUTS | shasum - | cut -f 1 -d " ")
         # Just don't change :target-path in project.clj, mkay?
         TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
+    else
+        TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+        trap "rm -f $TRAMPOLINE_FILE" EXIT
     fi
 
     if [ "$OSTYPE" = "cygwin" ]; then
@@ -256,19 +281,21 @@
         fi
         exec sh -c "exec $(cat $TRAMPOLINE_FILE)"
     else
-        $LEIN_JAVA_CMD \
+        export TRAMPOLINE_FILE
+        "$LEIN_JAVA_CMD" \
             -client -XX:+TieredCompilation \
+            "${BOOTCLASSPATH[@]}" \
             $LEIN_JVM_OPTS \
             -Dfile.encoding=UTF-8 \
             -Dmaven.wagon.http.ssl.easy=false \
             -Dleiningen.original.pwd="$ORIGINAL_PWD" \
-            -Dleiningen.trampoline-file="$TRAMPOLINE_FILE" \
-            -cp "$CLASSPATH" \
+            -Dleiningen.script="$SCRIPT" \
+            -classpath "$CLASSPATH" \
             clojure.main -m leiningen.core.main "$@"
 
         EXIT_CODE=$?
 
-        if [ -r "$TRAMPOLINE_FILE" ]; then
+        if [ -r "$TRAMPOLINE_FILE" ] && [ "$LEIN_TRAMPOLINE_WARMUP" = "" ]; then
             TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
             if [ "$INPUT_CHECKSUM" = "" ]; then
                 rm $TRAMPOLINE_FILE
--- a/dotcss/okcupid.com.css	Thu Jan 24 23:53:17 2013 -0500
+++ b/dotcss/okcupid.com.css	Tue Feb 12 11:11:48 2013 -0500
@@ -1,1 +1,4 @@
 #loveisblindday { display: none; }
+#likeonfacebook { display: none; }
+#masthead_wrapper { display: none !important; }
+#movie_match_promo { display: none !important; }
--- a/fish/config.fish	Thu Jan 24 23:53:17 2013 -0500
+++ b/fish/config.fish	Tue Feb 12 11:11:48 2013 -0500
@@ -1,4 +1,4 @@
-# Useful function {{{; $argv; end
+# Useful functions {{{
 
 function serve_this; python -m SimpleHTTPServer; end
 # alias fab 'fab -i ~/.ssh/stevelosh'
@@ -24,12 +24,15 @@
 function eg; vim ~/.gitconfig; end
 function es; vim ~/.slate; end
 
+function ss; bcvi --wrap-ssh -- $argv; end
+function bcvid; dtach -A /tmp/bcvi.socket bcvi --listener; end
+
 function spotlight-off; sudo mdutil -a -i off ; and sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/ ; and killall SystemUIServer; end
 function spotlight-on; sudo mdutil -a -i on ; and sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/ ; and killall SystemUIServer; end
 function spotlight-wat; sudo fs_usage -w -f filesys mdworker | grep "open" ; end
 
 set MUTT_BIN (which mutt)
-function mutt; bash --login -c 'cd ~/Desktop; $MUTT_BIN'; end
+function mutt; bash --login -c "cd ~/Desktop; $MUTT_BIN"; end
 
 function h; hg $argv; end
 function g; git $argv; end
--- a/gitconfig	Thu Jan 24 23:53:17 2013 -0500
+++ b/gitconfig	Tue Feb 12 11:11:48 2013 -0500
@@ -50,7 +50,7 @@
     delete-remote-branch = push origin --delete
     delete-local-reference-to-remote-branch = branch -rd
 
-    currentbranch = !git branch --contains HEAD | grep '*' | tr -s ' ' | cut -d ' ' -f2
+    currentbranch = rev-parse --abbrev-ref HEAD
 
     fo = fetch origin
     fu = fetch upstream
--- a/vim/vimrc	Thu Jan 24 23:53:17 2013 -0500
+++ b/vim/vimrc	Tue Feb 12 11:11:48 2013 -0500
@@ -350,7 +350,7 @@
 
 " Reformat line.
 " I never use l as a macro register anyway.
-nnoremap ql ^vg_gq
+nnoremap ql gqq
 
 " Easier linewise reselection
 nnoremap <leader>V V`]