Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ayyjayess on github.
  • I am ayyjayess (https://keybase.io/ayyjayess) on keybase.
  • I have a public key whose fingerprint is 5E1E 4A8D 9B4B 64AD 16E7 6DEE 2E14 82C4 C109 A153

To claim this, I am signing this object:

@ayyess
ayyess / mpd.nix
Last active February 12, 2018 22:57
# Adapted from Nixpkgs.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.mpd;
nixos = import <nixpkgs/nixos> {};
#include <random>
class Maybe {
std::mt19937 rng;
std::bernoulli_distribution coin;
public:
operator bool() { return coin(rng); }
} maybe;
#include <iostream>
using std::cout;
@ayyess
ayyess / main.cpp
Last active August 29, 2015 14:12
struct name being used for scope resolution
#include <iostream>
int main(int /*_argc*/, char ** /*_argv*/)
{
struct Foo {
Foo() {
std::cout << "foo" << std::endl;
}
};
Foo();
Foo::Foo();
@ayyess
ayyess / SpriteBatch.cpp
Last active April 20, 2021 15:13
SFML SpriteBatch
#include <SFML/Graphics.hpp>
class SpriteBatch
{
public:
SpriteBatch(sf::RenderTarget &rt);
~SpriteBatch(void);
void display(bool reset = true);
void draw(sf::Sprite &sprite);
@ayyess
ayyess / .ycm_extra_conf.py
Created August 30, 2014 07:16
Automatic ycm config file
import os
import ycm_core
from clang_helpers import PrepareClangFlags
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = 'build'