This article is now published on my website: A one-off git repo server.
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 <optix.h> | |
#include <optix_stubs.h> | |
#include <optix_function_table_definition.h> | |
#include <cuda.h> | |
namespace Denoiser | |
{ | |
static void CUDA_CHECK(CUresult result) | |
{ |
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
reset | |
set view equal xyz | |
unset border | |
unset tics | |
set xyplane 0 | |
set xrange [-3:3] | |
set yrange [-3:3] | |
set zrange [-3:3] | |
$cube << EOI |
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 <algorithm> | |
#include <cassert> | |
struct pair | |
{ | |
int term; | |
int sum; | |
pair operator + (int 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
#pragma once | |
#include <cstdint> | |
#include <x86intrin.h> | |
inline | |
std::uint32_t crc32c(const void * input, std::size_t size, std::uint32_t result = ~0) | |
{ | |
auto i8 = static_cast< const std::uint8_t * >(input); |
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
# save it as /etc/profile.d/ssh-telegram.sh | |
# use jq to parse JSON from ipinfo.io | |
# get jq from here http://stedolan.github.io/jq/ | |
USERID="<target_user_id>" | |
KEY="<bot_private_key>" | |
TIMEOUT="10" | |
URL="https://api.telegram.org/bot$KEY/sendMessage" | |
DATE_EXEC="$(date "+%d %b %Y %H:%M")" | |
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt' | |
if [ -n "$SSH_CLIENT" ]; then |
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
var http = require('http'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var AUDIOFILE = "./audio.ogg"; | |
function serveWithRanges(request, response, content) { | |
var range = request.headers.range; | |
var total = content.length; | |
var parts = range.replace(/bytes=/, "").split("-"); |
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 <boost/preprocessor/seq/for_each_i.hpp> | |
#include <boost/preprocessor/repetition/enum.hpp> | |
#include <utility> | |
#include <cstddef> | |
namespace details | |
{ |
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 <type_traits> | |
#include <utility> | |
template< std::size_t index, typename type > | |
struct ref { type & value; }; | |
template< std::size_t index, typename type > | |
type && get(ref< index, type > const & r) | |
{ | |
return std::forward< type >(r.value); |
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 <type_traits> | |
#include <utility> | |
#include <iterator> | |
#include <typeinfo> | |
#include <memory> | |
#include <mutex> | |
#include <string> | |
#include <cxxabi.h> |