Skip to content

Instantly share code, notes, and snippets.

Alex Ford asford

View GitHub Profile
@asford
asford / tyger.boxstarter.ps1
Last active Jun 15, 2020
Tyger Boxstarter
View tyger.boxstarter.ps1
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
# Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots
#
@asford
asford / init.vim
Created Aug 23, 2019
Example vim configuration.
View init.vim
set encoding=utf-8
call plug#begin("~/.vim/plugged")
" Generic navigation plugins
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'adelarsq/vim-matchit'
" Git support plugins
View hb_derivs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View test_cufflinks.ipynb
View gist:7738ecd887ae0a48cf31b8e770dad4be
[alias]
### Log formatting
#
# Commit graph
llog = log --pretty=format:'%x09%C(auto)%h %d %<(80,trunc)%s' --graph
# Short commit graph, abbreviated by reference
slog = log --pretty=format:'%x09%C(auto)%h %d %<(80,trunc)%s' --graph --simplify-by-decoration
# Upstream log
ulog = log --pretty=format:'%x09%C(auto)%h %d %<(80,trunc)%s' --graph @ @{u}
@asford
asford / gist:5476a49305214231349e7181a8aec20e
Created Dec 29, 2018
C++14 Compatible Tuple Operator Broadcast
View gist:5476a49305214231349e7181a8aec20e
#include <tuple>
#include <utility>
namespace internal
{
template<typename T, typename T2, size_t... Is>
void add_rhs_to_lhs(T& t1, const T2& t2, std::integer_sequence<size_t, Is...>)
{
auto l = { (std::get<Is>(t1) += std::get<Is>(t2), 0)... };
(void)l;
@asford
asford / gist:b87d2f67115989692210a5690f7c6ec3
Last active Dec 29, 2018
C++17 Tuple Operator Overloads
View gist:b87d2f67115989692210a5690f7c6ec3
// Fold expressions from https://medium.com/@matt.aubury/rip-index-sequence-2014-2017-9cc854aaad0
`
template <typename... Ts, typename... Us>
auto operator+(
const std::tuple<Ts...> &tuple_t, const std::tuple<Us...> &tuple_u) {
return std::apply(
[&](const auto &... ts) {
return std::apply(
[&](const auto &... us) { return std::tuple(ts + us...); },
tuple_u);
View casp_result_gazing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View debuglog.txt
+fordas@fela:~/workspace/pose_fork_depickle$ gdb
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
[...]
+(gdb) file python
:(gdb) run pose_serial_fork_bug.py fullsize1.pdb
Starting program: /home/fordas/workspace/pose_fork_depickle/.conda/bin/python pose_serial_fork_bug.py fullsize1.pdb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
You can’t perform that action at this time.