This file contains hidden or 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 <mutex> | |
#include <condition_variable> | |
using namespace std; | |
class semaphore | |
{ | |
public: | |
semaphore(int count_ = 0) : count{count_} | |
{} |
This file contains hidden or 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
# core {{{ | |
[core] | |
editor = /usr/bin/vim | |
excludesfile = /Users/npaolucci/.gitignore_global | |
pager=less -x4 | |
#}}} | |
# user {{{ | |
[user] | |
email = [email protected] |
This file contains hidden or 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 <cstdlib> | |
namespace { | |
static inline void init(void) { | |
std::ios_base::sync_with_stdio(false); | |
std::cin.tie(NULL); | |
} | |
constexpr static const size_t BUFF{256}; |
This file contains hidden or 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
# Taskwarrior simple checker for git repo | |
# If it finds one, use the project dir as the project filter | |
function t() { | |
git show &> /dev/null | |
retval=$? | |
if [ $retval -eq "0" ]; then | |
dir=$(git rev-parse --show-toplevel) | |
project=$(basename $dir) |
This file contains hidden or 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 <cstdlib> | |
#include <array> | |
using namespace std; | |
template <typename A> | |
using conref = const A&; | |
template <typename A, size_t sz> |
This file contains hidden or 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 <cstdlib> | |
#include <array> | |
#include <stdlib.h> | |
using namespace std; | |
template <typename A> | |
using conref = const A&; |
This file contains hidden or 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 <cstdlib> | |
#include <vector> | |
#include "pretty_print.hxx" | |
using namespace std; | |
template <typename A> | |
using conref = const A&; |
This file contains hidden or 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 <cstdlib> | |
#include "pretty_print.hxx" | |
using namespace std; | |
static inline bool naive(char* haystack, char* needle) { | |
for (int i = 0; haystack[i] != '\0'; ++i) { | |
if (haystack[i] == needle[0]) { |
This file contains hidden or 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
/** | |
* @param {number} a | |
* @param {number} b | |
* @param {number} c | |
* @param {number} d | |
* @return {bool} | |
*/ | |
function overlap(a, b, c, d) { | |
return b >= c && d >= a; | |
} |
This file contains hidden or 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
// | |
// Created by SGuzman on 4/3/2015. | |
// | |
#include <iostream> | |
static inline void print(const char* str) { | |
std::cout << str << std::endl; | |
} | |
class stuff : public std::string { |