As configured in my dotfiles.
start new:
tmux
start new with session name:
| void set_result(optional<error_code>* a, error_code b) | |
| { | |
| a->reset(b); | |
| } | |
| template <typename MutableBufferSequence> | |
| void read_with_timeout(tcp::socket& sock, | |
| const MutableBufferSequence& buffers) | |
| { | |
| optional<error_code> timer_result; | |
| deadline_timer timer(sock.io_service()); |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| /* | |
| * fizzbuzz.cpp | |
| * | |
| * Created on: Apr 25, 2012 | |
| * Author: Brian Geffon | |
| * | |
| * fizzbuzz solved without looping or conditionals using only template recursion. | |
| */ | |
| #include <iostream> |
| template <typename... T> | |
| constexpr auto make_array(T&&... values) -> | |
| std::array< | |
| typename std::decay< | |
| typename std::common_type<T...>::type>::type, | |
| sizeof...(T)> { | |
| return {std::forward<T>(values)...}; | |
| } |
| #include <array> | |
| #include <functional> | |
| template <typename... T> | |
| using common_type_t = typename std::common_type<T...>::type; | |
| template <typename T> | |
| using remove_cv_t = typename std::remove_cv<T>::type; | |
| template <bool, typename T, typename... U> |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| Add this to /etc/apt/sources.list | |
| <snip> | |
| deb http://security.ubuntu.com/ubuntu precise-security main restricted | |
| deb-src http://security.ubuntu.com/ubuntu precise-security main restricted | |
| deb http://security.ubuntu.com/ubuntu precise-security universe | |
| deb-src http://security.ubuntu.com/ubuntu precise-security universe | |
| deb http://security.ubuntu.com/ubuntu precise-security multiverse | |
| deb-src http://security.ubuntu.com/ubuntu precise-security multiverse | |
| </snip> |
| #include <iostream> | |
| #include <chrono> | |
| int main(int argc, char *argv[]) | |
| { | |
| auto tp = std::chrono::system_clock::now(); | |
| auto dur = tp.time_since_epoch(); | |
| auto seconds = std::chrono::duration_cast<std::chrono::seconds>(dur).count(); | |
| #!/usr/bin/env bash | |
| # --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\ | |
| function register_clang_version { | |
| local version=$1 | |
| local priority=$2 | |
| update-alternatives \ | |
| --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \ |