This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.1 | |
from subprocess import call, Popen, PIPE, check_call | |
import re | |
import sys | |
import os | |
import errno | |
# !! n.b. You probably shouldn't be using this - it's vastly faster and safer to use | |
# one of the other methods mentioned here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.1 | |
# This is script that extracts the trees of two commits to temporary | |
# directories and then runs meld on both directories, so you can compare | |
# them using meld's nice recursive browsing interface. | |
# | |
# This is for an answer to this question: | |
# http://stackoverflow.com/questions/2006032/view-differences-of-branches-with-meld | |
from subprocess import call, Popen, PIPE, check_call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '(ij.io DirectoryChooser)) | |
(import '(java.io File)) | |
(import '(java.io FileWriter)) | |
(import '(ij.plugin FolderOpener)) | |
(import '(ij IJ)) | |
(import '(ij.io FileSaver)) | |
;; d should be a java.io.File object | |
(defn files-in-directory [d] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2.6 | |
# This script "unsubmodulizes" a git repository - i.e. it takes a git | |
# repository with submodules and replaces the submodules with the | |
# history of the submodule merged into a subdirectory of the same | |
# name. I knocked this up quickly as an answer to this stackoverflow | |
# question: | |
# | |
# http://stackoverflow.com/questions/4542729/undo-submodulization-in-git | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking prerequisites of (fiji.build.SubFake) jars/weka.jar <- fiji jars/Fiji.jar ... | |
Building (fiji.build.SubFake) jars/weka.jar <- fiji jars/Fiji.jar ... | |
Building in modules/weka/ | |
Checking prerequisites of (fiji.build.ExecuteProgram) weka.jar <- weka/dist/weka.jar | |
Checking prerequisites of (fiji.build.ExecuteProgram) weka/dist/weka.jar <- | |
Building (fiji.build.ExecuteProgram) weka/dist/weka.jar <- | |
Executing: '../../fiji' '--ant' '-f' 'weka/build.xml' 'exejar' | |
Found that JAVA_HOME was: '/usr/lib/jvm/java-6-openjdk/' | |
Buildfile: weka/build.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os | |
from java.awt import Color | |
from ij3d import Image3DUniverse | |
univ = Image3DUniverse(512, 512) | |
univ.show() | |
# d = '/home/mark/painting-demo/static/data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A script that squashes your entire current branch down to a single commit, | |
# if this repository has a single root commit. This will change the object | |
# name of the root commit. This is for an answer to the Stack Overflow | |
# question: http://stackoverflow.com/questions/5266340/ | |
if [ -n "$(git status --porcelain)" ] | |
then | |
echo "git status wasn't clean - refusing to run..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
from tracing import PathAndFillManager | |
# An example script showing how to convert all the .traces | |
# files in a directory to SWC files. (The .traces format | |
# is the native file format of Simple Neurite Tracer.) | |
def run(): | |
d = IJ.getDirectory("Choose your directory of .traces files...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
CURRENT_BRANCH="$(git symbolic-ref HEAD)" | |
CURRENT_BRANCH_UPSTREAM="$(git rev-parse --symbolic-full-name @{u} 2> /dev/null)" | |
# Update the remote-tracking branches for every remote for which | |
# remote.<name>.skipDefaultUpdate is not true: | |
git remote update default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
require 'statistics2' | |
class Numeric | |
def to_percent | |
"#{(self * 100).round}%" | |
end | |
end |