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
void Viewer::do_reflections() | |
{ | |
if (Settings::reflections) | |
{ | |
Settings::cel_reflection = true; | |
glColorMask(0, 0, 0, 0); | |
glEnable(GL_STENCIL_TEST); | |
glStencilFunc(GL_ALWAYS, 1, 1); |
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
#!/bin/bash | |
BACKUP_BUCKET=s3backupbucketname | |
pushd /mnt/backup/gphotos | |
/home/ubuntu/.local/bin/gphotos-sync/gphotos-sync . | |
tar cf - . | aws s3 cp --storage-class=DEEP_ARCHIVE - s3://$BACKUP_BUCKET/gphoto.tar | |
popd |
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
template<typename E> | |
constexpr typename std::underlying_type<E>::type toBase(E e) noexcept | |
{ | |
return static_cast<typename std::underlying_type<E>::type>(e); | |
} |
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 <x86intrin.h> | |
#include <stdint.h> | |
constexpr bool is_powerof2(int v) { | |
return v && ((v & (v - 1)) == 0); | |
} | |
template<typename Key, size_t NumElements> | |
struct aesHash | |
{ |
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 | |
/* Let's you map a non-contiguous enum class to a contiguously packed array for better performance | |
ie: | |
enum class ABC { A = 'A', B = 'B', C = 'C', D = 'D' }; | |
typedef PackedEnum<ABC::B, ABC::A, ABC::C> PackedABC; | |
At compile time: | |
PackedABC::list wil be { ABC::B, ABC::A, ABC::C } |
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
#!/usr/bin/env python3 | |
print(''' | |
#pragma once | |
#include <type_traits> | |
#include <tuple> | |
// Converts POD struct to std::tuple | |
// Autogenerated by totuple.py |
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
/* | |
Fixed-size, nearly wait-free lockless queue implementation that is simple enough to debug quickly. | |
Similar to the Array-based Queue-lock on p150 of The Art of Multiprocessor Programming but with pointers | |
in the queue instead of flags. | |
Implementation: | |
Before doing anything, both reader and writer claim their index using atomic add/subtract. This | |
allows multiple readers and writers to not clobber eachother. | |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
var latAndLong = '40.736901,-73.990692' | |
function getJSONP(url, success) { | |
var ud = '_' + +new Date, | |
script = document.createElement('script'), |
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 <pgobootrun.h> | |
#include <TlHelp32.h> | |
#pragma comment(lib, "pgobootrun.lib") | |
//static int threadcount = 0; | |
inline void sweep() | |
{ | |
if( getenv("PGOSWEEP") ) // can't #define this or it will undo PGO update |