Skip to content

Instantly share code, notes, and snippets.

View kaidokert's full-sized avatar

Kaido Kert kaidokert

View GitHub Profile
@Airtnp
Airtnp / cpp_idiom.md
Last active December 27, 2017 02:52
Cpp Idioms (raw has better view)

Cpp Idioms

#

  • [[...]] attribute
    • [[using namespace : attribute_list]]
    • [[noreturn]]
      • std::exit/terminate/abort, throw, infinite loop
      • never return to previous control flow, the next control flow never execute
  • asm volatile (
@bkaradzic
bkaradzic / orthodoxc++.md
Last active November 15, 2024 12:57
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@henrysher
henrysher / reinvent.md
Last active October 9, 2024 15:54
link for reinvent slides
@sztomi
sztomi / func_try_block.cpp
Created May 7, 2014 14:17
This file demonstrates the usage of function try blocks for implementing thread-safe copy constructors. Note, that the equality operator for ExpensiveFoo is omitted (implicitly default), so in reality, there would be even more time spent in the BarSlow copy constructor than in this example.
#include <chrono>
#include <iostream>
#include <mutex>
#include <thread>
struct ExpensiveFoo
{
ExpensiveFoo()
{
std::cout << "ExpensiveFoo default constructor... ";
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active November 14, 2024 15:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@dsanders11
dsanders11 / StringConstant.h
Last active February 15, 2023 21:53
An implementation of compile time string constants in C++14. The StringConstant class provides an intuitive interface for concatenating and comparing equality of the string constants. Heavily commented since example template code never seems to be.
#ifndef STRING_CONSTANT_H
#define STRING_CONSTANT_H
#include <cstddef>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
@hellysmile
hellysmile / repositories.py
Last active February 3, 2023 22:27
django repository pattern
from django.contrib.sites.models import Site
class Object(object):
def __init__(self, model, key):
self.model = model
self.key = key
def __call__(self, *args, **kwargs):
params = {}
@cobusc
cobusc / postgresql_date_function_index_howto.md
Last active July 26, 2024 09:16
Short explanation of the issues faced when trying to create a PostgreSQL index using the date() function and how to resolve it.
@nettles-jarrod
nettles-jarrod / blog - Switching to Homebrew.md
Created April 2, 2013 04:57
Switching from Macports to Homebrew and getting my development environment back.

I've been a MacPorts user for quite awhile now. There was nothing religious about the decision - on my first day of work I was handed a new Macbook Pro and proceeded to set up a development environment. Tried to, anyway. While I'd been an avid Mac user for most of my life I'd never actually used it for serious web development - I did some small work back in the 90's but that was the days of OS9 and it was all un-Unixy. Long story short: I was a newb at developing on OSX.

Being an Ubuntu user, I was pretty spoiled by apt-get. After about three mintues of trying to compile stuff myself I marched back into my boss's office and asked if there was a package manager for OSX. He directed me to the Mac Ports website and I left extremely relieved. I think I ran across Homebrew at some point but I never explored it further.

For about three months this was satisfactory. MacPorts works well enough but it has a habit of annoying you at certain intersections. The biggest problem, though, was that the rest of the wo