Skip to content

Instantly share code, notes, and snippets.

@MathiasPius
MathiasPius / Dockerfile
Last active September 25, 2023 16:14
Quickly updating jellyfin app on Tizen TVs.
FROM ubuntu:latest as tizen
RUN apt-get update
RUN apt-get install wget -y
RUN wget https://download.tizen.org/sdk/Installer/tizen-studio_5.1/web-cli_Tizen_Studio_5.1_ubuntu-64.bin
RUN chmod u+x web-cli_Tizen_Studio_5.1_ubuntu-64.bin
RUN chown 1000:1000 web-cli_Tizen_Studio_5.1_ubuntu-64.bin
RUN useradd -ms /bin/bash tizen
USER tizen
RUN /bin/bash -c 'echo y |./web-cli_Tizen_Studio_5.1_ubuntu-64.bin --accept-license'
#include <vector>
#include <iostream>
using block_type = unsigned char;
using block_container = std::vector<block_type>;
using block_iterator = block_container::const_iterator;
// Get the counter and top-most bits
// (1111 1111) / 2 = (0111 1111) integer division always rounds down
static const block_type counter_bits =
std::numeric_limits<block_type>::max() / 2;
namespace detail
{
template<typename ...>
struct concat;
template<template<typename ...> typename T, typename ...Args, typename ...Ts>
struct concat<T<Args...>, Ts...>
{
// This function just generates an index_sequence over Args and forwards
// it to the other construct function within this structure
#include <iostream>
#include <vector>
template<typename Image, typename PixelType = typename Image::pixel_type>
struct view
{
view(Image &img,
unsigned int x,
unsigned int y,
unsigned int width,
int main()
{
// Ranged-based iteration
for(auto i : static_interval<0, 10, 2>())
std::cout << i << " ";
std::cout << std::endl;
// Reverse manual iteration
auto m = static_interval<1, 10>();
@MathiasPius
MathiasPius / gist:4650089
Created January 27, 2013 19:51
Vector unit tests
template<typename storage>
void vec3_test()
{
// Standard constructor
vector<3, storage> control(1, 2, 3);
assert(control.x == 1);
assert(control.y == 2);
assert(control.z == 3);
// Construct from initialization list
#include <Windows.h>
#include <exception>
#include <Dbghelp.h>
#include <iostream>
#include <Psapi.h>
#include <string>
#include <vector>
#pragma comment(lib, "Dbghelp.lib")