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 | |
# Usage: salloc <options> slurm-ssh | |
first=$(scontrol show hostname $SLURM_NODELIST | head -n1) | |
env=$(printenv | grep SLURM | sed -rn "s/=(.*)/='\1'/p" | paste -d' ' -s) | |
exec ssh $first -t "$env zsh" |
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 inspect | |
import re | |
def fmt(s): | |
""" | |
Interpolate arbitrary expressions inside '{}' in strings (similar to Ruby or Scala). | |
It should go without saying that because this uses `eval`, it is unsafe to use with any user-provided inputs. | |
It is also probably terribly slow because it's using `inspect` to get the caller's local variables. | |
Example: |
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
#include <accel-cpp/log.hpp> | |
#include <boost/variant.hpp> | |
#include <map> | |
#include <vector> | |
#include <sstream> | |
using namespace std; | |
enum SyncMode { async, blocking }; | |
enum BalancingMode { none, balancing }; |
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
diff --git a/trunk/src/stl_logging_unittest.cc b/trunk/src/stl_logging_unittest.cc | |
--- a/trunk/src/stl_logging_unittest.cc (revision 137) | |
+++ b/trunk/src/stl_logging_unittest.cc (working copy) | |
@@ -31,17 +31,20 @@ | |
#ifdef HAVE_USING_OPERATOR | |
-#ifdef __GNUC__ | |
+#include <iostream> | |
+ |
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
#include <mpi.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char* argv[]) { | |
MPI_Init(&argc, &argv); | |
int rank, size; | |
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | |
MPI_Comm_size(MPI_COMM_WORLD, &size); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>NSWorkspace</key> | |
<key>SystemConfiguration</key> | |
<dict> | |
<key>State:/Network/Global/IPv4</key> | |
<dict> | |
<key>command</key> |
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
source ~/grappa/system/grappa_gdb.macros | |
# blue (gdb) prompt | |
set prompt \033[0;34m(gdb)\033[0m | |
shell mkfifo /tmp/bholt_gdb_color_pipe | |
define hook-backtrace | |
shell cat /tmp/bholt_gdb_color_pipe | sed -e 's/\(^#[0-9]*.*in \|^#[0-9]*\) \(.*\) \((.*)\)/\1 '$(echo -e '\033[0;33m')'\2 '$(echo -e '\033[0;36m')'\3'$(echo -e '\033[0m')'/' | sed -e 's/\/sampa\/home\/bholt\(\/.*:[0-9]*\)/'$(echo -e '\033[0;32m')'~\1'$(echo -e '\033[0m')'/' & | |
set logging redirect on |
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 | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
if git rev-parse --verify HEAD >/dev/null 2>&1 |
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
# start a new session if there isn't one to attach to already | |
new-session | |
# Make global tmux shortcut "ctrl+t" | |
set -g prefix ^t | |
# Renumber windows when they're closed so you don't have weird missing numbers. | |
set-option -g renumber-windows on | |
# Make colors work right. |
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/env ruby | |
require "rubyvis" | |
vis = Rubyvis::Panel.new do | |
width 150 | |
height 150 | |
bar do | |
data [1, 1.2, 1.7, 1.5, 0.7, 0.3] | |
width 20 | |
height {|d| d * 80} |
NewerOlder