See the blog post Quick and dirty PHP autoloading using Composer for details of how to use this.
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
*~ | |
*.[oa] | |
*.l[ao] | |
.deps | |
.libs |
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
template<typename T, std::size_t Size> | |
struct Stack | |
{ | |
T m_data[Size](); | |
std::size_t pos = 0; | |
template<typename ... Arg> | |
void constexpr emplace_back(Arg &&... arg) | |
{ | |
m_data[pos] = T{std::forward<Arg>(arg)...}; |
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
template<typename Data, std::size_t Cols, std::size_t Rows> | |
struct Array2D | |
{ | |
constexpr static auto rows() { return Rows; } | |
constexpr static auto cols() { return Cols; } | |
constexpr Data &operator()(const std::size_t col, const std::size_t row) | |
{ | |
return m_data[col + (row * Cols)]; | |
} |
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
template<typename T, typename Gen> | |
constexpr auto distribution(Gen &g, T min, T max) | |
{ | |
const auto range = max - min + 1; | |
const auto bias_remainder = std::numeric_limits<T>::max() % range; | |
const auto unbiased_max = std::numeric_limits<T>::max() - bias_remainder - 1; | |
auto r = g(); | |
for (; r > unbiased max; r = g()); |
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 <array> | |
#include <utility> | |
#include <sstream> | |
template<int I> | |
struct Fib | |
{ | |
static const int val Fib<I-1>::val + Fib<I-2>::val; | |
}; |
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
#!/usr/bin/env bash | |
# Utility to change the connection method for a git repo. | |
# === Colour Definitions === | |
red='\e[0;31m' | |
green='\e[0;32m' | |
purple='\e[0;35m' | |
orange='\e[0;33m' | |
# No Color, i.e. turn off color |
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
pipeline { | |
agent any | |
stages { | |
stage('Build') { | |
steps { | |
echo 'Build demo-app' | |
sh 'sh run_build_script.sh' | |
} | |
} |
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
#!/usr/bin/env python3 | |
import serial | |
import sys | |
import os | |
import threading | |
import traceback | |
if len(sys.argv) not in (2, 3): | |
print(f"Usage: {sys.argv[0]} <path> [baud]") |
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
$ iptool | |
lo (loopback; up; ID: 1): | |
127.0.0.1/8 (host) | |
::1/128 (host) | |
eth0 (Ethernet; up; ID: 2; MAC addr: 00:xx:xx:xx:yy:yy): | |
192.168.1.0/24 | |
1d67:bd71:56d9:13f3:5499:25b:cc84:f7e4/64 | |
wlan0 (Ethernet; disabled; ID: 3; MAC addr: 00:xx:xx:xx:yy:yy): |
NewerOlder