Skip to content

Instantly share code, notes, and snippets.

git remote add -f history https://github.com/(..)/(..)history.git
git replace $(git rev-list --reverse HEAD | sed -n -e 2p) history/master
git remote rm history
Index: tst_scan_static_reflection_predictor.py
===================================================================
--- tst_scan_static_reflection_predictor.py (revision 5597)
+++ tst_scan_static_reflection_predictor.py (working copy)
@@ -33,23 +33,35 @@
self.reflections = flex.reflection_table.from_pickle(reflection_filename)
def run(self):
+ self.tst_number_of_predictions()
self.tst_vs_old()
#!/bin/bash
rm -rf base.old build.old
if [ -d base ]; then
mv base base.old
fi
if [ -d build ]; then
mv build build.old
fi
if [ -d base_tmp ]; then
cd base_tmp
#!/bin/bash
function parse_git_branch () {
if [[ -z $(git status --porcelain) ]]; then
echo -ne "\001\033[0;32m\002"
else
echo -ne "\001\033[1;31m\002"
fi
BRANCH=`git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
echo -n $BRANCH
@Anthchirp
Anthchirp / bork.txt
Created January 13, 2017 14:45
dials 1.4.2 test breakage
libtbx.python "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/modules/xia2_regression/test/xia2/tst_mad_example.py" dials [FAIL]
Time: 910.85
Return code: 1
OKs: 0
Standard error:
Traceback (most recent call last):
File "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/build/../modules/xia2/command_line/xia2_main.py", line 282, in run
xinfo = xia2_main()
File "/scratch/jenkins_slave/workspace/dials_release_test/dials-v1-4-2/build/../modules/xia2/command_line/xia2_main.py", line 233, in xia2_main
Chatter.write(xinfo.get_output(), strip=False)
@Anthchirp
Anthchirp / .bashrc_local
Created April 26, 2017 08:26
su && screen
# Getting screen to work on a user account you su'd to.
function screen() {
/usr/bin/script -q -c "/usr/bin/screen ${*}" /dev/null
}
#!/bin/sh
wget https://raw.githubusercontent.com/cctbx/cctbx_project/master/libtbx/auto_build/bootstrap.py
python bootstrap.py --builder=dials hot update base build
@Anthchirp
Anthchirp / whowrotedis.sh
Last active June 8, 2018 18:01
Code ownership
find . -type f | grep "\.\(py\|cc\|h\)$" | xargs -n 1 git blame -w -c -C | cut -d"(" -f 2 | cut -d")" -f 1 | sed -e "s/^\([a-zA-Z .]*\).*/\\1/" | sort | uniq -c | sort -n
from __future__ import absolute_import, division, print_function
import itertools
import operator
ops = {operator.add: '+', operator.sub: '-', operator.mul: '*', operator.truediv: '/'}
def run(a, b, c, d, op1, op2, op3, order):
try:
if order == 1:
return op1(a, op2(b, op3(c, d)))
@Anthchirp
Anthchirp / .bashrc_local
Created February 7, 2019 09:18
GIT prompt
function __ps1_git () {
# preserve exit status
local exit=$?
local repo_info
repo_info="$(git rev-parse --git-dir --is-inside-git-dir --is-inside-work-tree 2>/dev/null)"
if [ -z "$repo_info" ]; then
return $exit
fi