View bmatrix.m
function code = bmatrix(X) | |
code = "\\begin{bmatrix}" + newline; | |
rows = size(X, 1); | |
cols = size(X, 2); | |
for i=1:rows | |
for j=1:cols | |
if j == cols | |
code = code + X(i, j) + " \\\\"; | |
else | |
code = code + X(i, j) + " & "; |
View watch_sync.py
import sys | |
import time | |
import logging | |
from watchdog.observers import Observer | |
from watchdog.events import RegexMatchingEventHandler | |
from subprocess import call | |
import argparse | |
class RsyncHandler(RegexMatchingEventHandler): | |
def __init__(self, path, target): |
View vocab.txt
repeated too often as to lose meaning | |
- banal | |
- trite | |
- platitude (a trite remark) | |
- hackneyed (lacking significance from overuse) | |
- bromide (a trite or obvious remark) | |
dull | |
- insipid (lacking flavour or interest) | |
- prosaic (dull and lacking imagination) |
View .screenrc
# For a complete list of available commands, see http://bit.ly/jLtj | |
# Message to display in the status line when activity is detected in a | |
# monitored window. | |
activity "activity in %n (%t) [%w:%s]~" | |
# Detach session on hangup instead of terminating screen completely. | |
autodetach on # default: on | |
# When a bell character is sent to a background window, screen displays a |
View pre-commit.hook
#!/bin/bash | |
# | |
# Check that all source files follow a fixed format. | |
# Called by "git commit" with no arguments. | |
# Commit is blocked if any file does not follow format and outputs | |
# command to format them. | |
# Enable this by copying this file into .git/hooks/pre-commit | |
ROOT=$(git rev-parse --show-toplevel) | |
FORMATTER="clang-format" |
View .clang-format
# put in project root | |
--- | |
# We'll use defaults from the LLVM style, but with 4 columns indentation. | |
BasedOnStyle: LLVM | |
IndentWidth: 4 | |
--- | |
Language: Cpp | |
# Force pointers to the type for C++. | |
DerivePointerAlignment: false |
View grape
#!/bin/bash | |
grep -rn --color=always --include=\*.{cpp,hpp,c,h} $@ |
View clear_terminal
printf "\033c" |
View mode_docs_spreadsheet
=query(index(if({1,1},upper(D3:D24)&"")),"select Col1,count(Col2) where Col1<>'' group by Col1 order by count(Col2) desc",0) |
View g11
filename=$(basename "$1") | |
outfile="${filename%.*}" | |
{ g++ -o $outfile $@ -std=c++11 2>&1; } | tee log.txt |
NewerOlder