Skip to content

Instantly share code, notes, and snippets.

@andrewseidl
andrewseidl / ssh-copy-id
Created September 8, 2013 20:57
ssh-copy-id for systems that don't ship with it (MacOSX)
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then

Keybase proof

I hereby claim:

  • I am andrewseidl on github.
  • I am andrewseidl (https://keybase.io/andrewseidl) on keybase.
  • I have a public key whose fingerprint is 7E33 6EA3 B41A 2866 2BA5 A8EE 8FD8 092E AC25 D678

To claim this, I am signing this object:

@andrewseidl
andrewseidl / aws-arch-setup.txt
Last active October 17, 2015 07:10
Commands to install Yaourt and setup user access to Arch running on AWS
curl https://github.com/andrewseidl.keys >> ~/.ssh/authorized_keys
sudo pacman --noconfirm -Syyu
sudo pacman --noconfirm -S base-devel vim zsh wget yajl tmux mlocate
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz
tar xvf package-query.tar.gz
tar xvf yaourt.tar.gz
cd package-query
makepkg -i --noconfirm
cd ../yaourt
@andrewseidl
andrewseidl / Clang-format Comparison.md
Last active April 10, 2024 04:10
Clang-format style comparison

This is a comparison of the different formatting styles including with clang-format.

Generated via:

styles=( LLVM Google Chromium Mozilla WebKit )
for style in $styles
do
  clang-format -style=$style ChLcpIterativeAPGD.h > ChLcpIterativeAPGD.$style.h

done

  • update system
    sudo yum update
  • install xmonad, xmonad-contrib, xmobar
    sudo yum install xmonad ghc-xmonad-contrib{,-devel} xmobar
  • install cabal-install, for yeganesh
# - Find the MAGMA library
# - Based on https://github.com/bravegag/eigen-magma-benchmark
#
# Usage:
# find_package(MAGMA [REQUIRED] [QUIET] )
#
# It sets the following variables:
# MAGMA_FOUND ... true if magma is found on the system
# MAGMA_LIBRARY_DIRS ... full path to magma library
# MAGMA_INCLUDE_DIRS ... magma include directory

https://www.atlassian.com/git/

For those of you new to git or just looking for a refresher, the link above is awesome. There are even a few places which relate git commands to their SVN equivalents.

Beyond that, here are some of my tips:

  • Force yourself to use git from the terminal. Sourcetree is great for getting up and running quickly, but you'll have a much easier time you understand what the commands do. Eventually the GUI just gets in your way.

  • Sync with the upstream/parent branch regularly. This will let you deal with conflicts as they happen, instead of having to fix everything at the end.

In the current directory, find all files ending in .(cpp|cu|glsl|h) that are not named *FontData* and are not in a path matching *thirdparty*. Run clang-format on each of these files, using the format specified in .clang-format.

Chrono-Parallel

Linux/GNU find:

find . \( -regex '.*\.\(cpp\|cu\|glsl\|h\)' ! -iname '*FontData*' ! -ipath '*thirdparty*' \) -exec clang-format -i '{}' \;

OSX/BSD find:

% ClangFormat All The Things % Andrew Seidl % 27 February 2015

ClangFormat All The Things

ClangFormat All The Things

ClangFormat

  • C/C++/ObjC source code formatter
@andrewseidl
andrewseidl / AsciiDocker.txt
Created April 10, 2015 07:01
Ascii Docker
## .
## ## ## ==
## ## ## ## ## ===
/""""""""""""""""""\___/ ===-
~~~ {~~ ~~~~ ~~~ ~~~ ~~ ~~ ~ / ===- ~~~
\ o __/
\____/ __/
\______________/
| |