ee9ac60c856c

Moar.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 19 Sep 2012 11:00:34 -0400
parents 4878bb465b63
children 3914c613a920
branches/tags (none)
files .hgsubstate bin/lein dotjs/unisubs.sifterapp.com.js moom/com.manytricks.Moom.plist vim/vimrc

Changes

--- a/.hgsubstate	Wed Sep 12 10:14:24 2012 -0400
+++ b/.hgsubstate	Wed Sep 19 11:00:34 2012 -0400
@@ -20,7 +20,7 @@
 20ab08c9a8fe6cdfb7c303aa3063f211d72f8b2f vim/bundle/powerline
 49ae47e66f51c92b0f467f9817d5d8745f627132 vim/bundle/python-mode
 61a7567a3cdd68cb65ceb3061071ce66d8110e65 vim/bundle/salt
-bfbc5e5ca7ce0722af74da24ddc266eed0dfe112 vim/bundle/slimv
+13c85f67a22848659f4365ae08567bb0d72bfc58 vim/bundle/slimv
 78ab4b3df24fa2753d3dfc1be75ed5a3df1565b8 vim/bundle/smartinput
 c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
 3a2ab096c039516a8f43e6acd0264d8a81cd0544 vim/bundle/splice
--- a/bin/lein	Wed Sep 12 10:14:24 2012 -0400
+++ b/bin/lein	Wed Sep 19 11:00:34 2012 -0400
@@ -1,6 +1,10 @@
 #!/usr/bin/env bash
 
-export LEIN_VERSION="2.0.0-preview7"
+# Ensure this file is executable via chmod a+x lein, then place it
+# 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"
 
 case $LEIN_VERSION in
     *SNAPSHOT) SNAPSHOT="YES" ;;
@@ -27,6 +31,12 @@
 
 export LEIN_HOME=${LEIN_HOME:-"$HOME/.lein"}
 
+for f in "$LEIN_HOME/leinrc" ".leinrc"; do
+  if [ -e $f ]; then
+    source $f
+  fi
+done
+
 if [ "$OSTYPE" = "cygwin" ]; then
     export LEIN_HOME=`cygpath -w $LEIN_HOME`
 fi
@@ -53,6 +63,10 @@
 
 BIN_DIR="$(dirname "$SCRIPT")"
 
+# 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'}
+
 if [ -r "$BIN_DIR/../src/leiningen/version.clj" ]; then
     # Running from source checkout
     LEIN_DIR="$(dirname "$BIN_DIR")"
@@ -87,11 +101,15 @@
     fi
 
     mkdir -p "$LEIN_DIR/target/classes"
-    export LEIN_JVM_OPTS=${LEIN_JVM_OPTS:-"-Dclojure.compile.path=$LEIN_DIR/target/classes"}
+    export LEIN_JVM_OPTS="${LEIN_JVM_OPTS:--Xms64m -Xmx256m} -Dclojure.compile.path=$LEIN_DIR/target/classes"
+
     CLASSPATH="$LEIN_DIR/leiningen-core/src/"
     CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/resources/"
-    CLASSPATH="$CLASSPATH:$(cat $LEIN_DIR/.lein-classpath 2> /dev/null)"
-    CLASSPATH="$CLASSPATH:$LEIN_DIR/leiningen-core/lib/*"
+    if [ -r "$LEIN_DIR/.lein-classpath" ]; then
+        CLASSPATH="$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
@@ -123,6 +141,17 @@
     fi
 fi
 
+function download_failed_message {
+    echo "Failed to download $1"
+    echo "It's possible your HTTP client's certificate store does not have the"
+    echo "correct certificate authority needed. This is often caused by an"
+    echo "out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT"
+    echo "to turn off certificate checks:"
+    echo "  export HTTP_CLIENT=\"wget --no-check-certificate -O\" # or"
+    echo "  export HTTP_CLIENT=\"curl --insecure -f -L -o"
+}
+
+# TODO: explain what to do when Java is missing
 export JAVA_CMD=${JAVA_CMD:-"java"}
 export LEIN_JAVA_CMD=${LEIN_JAVA_CMD:-$JAVA_CMD}
 
@@ -142,19 +171,16 @@
     LEIN_DIR=`dirname "$LEIN_JAR"`
     mkdir -p "$LEIN_DIR"
     LEIN_URL="https://github.com/downloads/technomancy/leiningen/leiningen-$LEIN_VERSION-standalone.jar"
-    $HTTP_CLIENT "$LEIN_JAR" "$LEIN_URL"
-    if [ $? != 0 ]; then
-        echo "Failed to download $LEIN_URL"
-        echo "If you have an old version of libssl you may not have the correct"
-        echo "certificate authority. Either upgrade or set HTTP_CLIENT to insecure:"
-        echo "  export HTTP_CLIENT=\"wget --no-check-certificate -O\" # or"
-        echo "  export HTTP_CLIENT=\"curl --insecure -f -L -o"
+    $HTTP_CLIENT "$LEIN_JAR.pending" "$LEIN_URL"
+    if [ $? == 0 ]; then
+        # TODO: checksum
+        mv -f "$LEIN_JAR.pending" "$LEIN_JAR"
+    else
+        rm "$LEIN_JAR.pending" 2> /dev/null
+        downoad_failed_message "$LEIN_URL"
         if [ $SNAPSHOT = "YES" ]; then
-            echo "If you have Maven installed, you can do"
-            echo "mvn dependency:copy-dependencies; mv target/dependency lib"
-            echo "See README.md for further SNAPSHOT build instructions."
+            echo "See README.md for SNAPSHOT-specific build instructions."
         fi
-        rm $LEIN_JAR 2> /dev/null
         exit 1
     fi
 elif [ "$1" = "upgrade" ]; then
@@ -184,11 +210,16 @@
                     TARGET=`cygpath -w $TARGET`
                 fi
                 LEIN_SCRIPT_URL="https://github.com/technomancy/leiningen/raw/$TARGET_VERSION/bin/lein"
-                $HTTP_CLIENT "$TARGET" "$LEIN_SCRIPT_URL" \
-                    && mv "$TARGET" "$SCRIPT" \
-                    && chmod +x "$SCRIPT" \
-                    && echo && "$SCRIPT" self-install && echo && echo "Now running" `$SCRIPT version`
-                exit $?;;
+                $HTTP_CLIENT "$TARGET" "$LEIN_SCRIPT_URL"
+                if [ $? == 0 ]; then
+                    mv "$TARGET" "$SCRIPT" \
+                        && chmod +x "$SCRIPT" \
+                        && echo && "$SCRIPT" self-install \
+                        && echo && echo "Now running" `$SCRIPT version`
+                    exit $?
+                else
+                    download_failed_message "$LEIN_SCRIPT_URL"
+                fi;;
             *)
                 echo "Aborted."
                 exit 1;;
@@ -202,31 +233,49 @@
     fi
 
     if [ $DEBUG ]; then
-        echo "Classpath: $CLASSPATH"
+        echo "Leiningen's classpath: $CLASSPATH"
     fi
 
-    TRAMPOLINE_FILE="/tmp/lein-trampoline-$$"
+    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)"
+        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"
+    fi
+
     if [ "$OSTYPE" = "cygwin" ]; then
         TRAMPOLINE_FILE=`cygpath -w $TRAMPOLINE_FILE`
     fi
 
-    $LEIN_JAVA_CMD \
-        -client -XX:+TieredCompilation \
-        $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" \
-        clojure.main -m leiningen.core.main "$@"
+    if [ "$INPUT_CHECKSUM" != "" ] && [ -r "$TRAMPOLINE_FILE" ]; then
+        if [ $DEBUG ]; then
+            echo "Fast trampoline with $TRAMPOLINE_FILE."
+        fi
+        exec sh -c "exec $(cat $TRAMPOLINE_FILE)"
+    else
+        $LEIN_JAVA_CMD \
+            -client -XX:+TieredCompilation \
+            $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" \
+            clojure.main -m leiningen.core.main "$@"
 
-    EXIT_CODE=$?
+        EXIT_CODE=$?
 
-    if [ -r $TRAMPOLINE_FILE ]; then
-        TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
-        rm $TRAMPOLINE_FILE
-        exec sh -c "exec $TRAMPOLINE"
-    else
-        exit $EXIT_CODE
+        if [ -r "$TRAMPOLINE_FILE" ]; then
+            TRAMPOLINE="$(cat $TRAMPOLINE_FILE)"
+            if [ "$INPUT_CHECKSUM" = "" ]; then
+                rm $TRAMPOLINE_FILE
+            fi
+            exec sh -c "exec $TRAMPOLINE"
+        else
+            exit $EXIT_CODE
+        fi
     fi
 fi
--- a/dotjs/unisubs.sifterapp.com.js	Wed Sep 12 10:14:24 2012 -0400
+++ b/dotjs/unisubs.sifterapp.com.js	Wed Sep 19 11:00:34 2012 -0400
@@ -134,5 +134,11 @@
             document.location = $tickets.eq(num).attr('href');
         };
     }
+
+    $('div.comment').each(function (idx, el) {
+        var id = $(el).attr('id');
+        var link = '<a href="#' + id + '">permalink</a>';
+        $(el).find('.timestamp').append(link);
+    });
 });
 
Binary file moom/com.manytricks.Moom.plist has changed
--- a/vim/vimrc	Wed Sep 12 10:14:24 2012 -0400
+++ b/vim/vimrc	Wed Sep 19 11:00:34 2012 -0400
@@ -219,6 +219,8 @@
 
 iabbrev sl@ steve@stevelosh.com
 iabbrev vrcf `~/.vimrc` file
+
+iabbrev pcf Participatory Culture Foundation
 inoremap <c-l> <c-k>l*
 
 " }}}
@@ -575,7 +577,7 @@
 
 augroup ft_c
     au!
-    au FileType c setlocal foldmethod=syntax
+    au FileType c setlocal foldmethod=marker foldmarker={,}
 augroup END
 
 " }}}
@@ -984,6 +986,7 @@
 " Ack {{{
 
 nnoremap <leader>a :Ack!<space>
+let g:ackprg = 'ag --nogroup --nocolor --column'
 
 " }}}
 " Autoclose {{{
@@ -1237,7 +1240,7 @@
 " let g:slimv_repl_syntax = 0
 let g:slimv_repl_wrap = 0
 
-let g:paredit_mode = 0
+" let g:paredit_mode = 0
 
 " Use a swank command that works, and doesn't require new app windows.
 let g:slimv_swank_clojure = '!dtach -n /tmp/dtach-swank.sock -r winch lein swank'