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 <climits> | |
#include <cstdint> | |
#include <type_traits> | |
struct clzll_tag {}; | |
struct clzl_tag : clzll_tag {}; | |
struct clz_tag : clzl_tag {}; | |
template <typename T, typename = typename std::enable_if<sizeof(T) <= sizeof(unsigned int)>::type> | |
unsigned clz_impl(clz_tag, T x) |
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
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l 8080 |
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
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-11-29 09:02:10.000000000 +1300 | |
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-04-18 22:31:06.673656387 +1200 | |
@@ -4816,8 +4816,13 @@ | |
{ | |
unsigned long orig_level; | |
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) | |
orig_level = __get_cpu_var(kasExecutionLevel); | |
__get_cpu_var(kasExecutionLevel) = level; | |
+#else |
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 <iostream> | |
#include <future> | |
using namespace std; | |
template <typename Fn, typename... Args> | |
auto do_async_with_log(ostream& os, Fn&& fn, Args&&... args) -> | |
future<decltype(fn(args...))> | |
{ | |
os << "[TID=" << this_thread::get_id() |
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
# download latest libevent2 and tmux sources, and extract them somewhere | |
# (thx bluejedi for tip on latest tmux URL) | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel |
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
function git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
} |