- 1 kg de courgettes
- 2 oignons jaunes
- 2 tomates broyées
- huile
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
@pytest.fixture | |
def capture_logging() -> Generator[StringIO, None, None]: | |
sio = StringIO() | |
sh = StreamHandler(stream=sio) | |
log.addHandler(sh) | |
yield sio | |
log.removeHandler(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
#!/bin/bash | |
# Drop this in a project .git/hooks/prepare-commit-msg | |
COMMIT_MSG_FILE=$1 | |
COMMIT_SOURCE=$2 | |
# SHA1 is not empty if it's a rebase / ammend | |
SHA1=$3 | |
# template | |
# summary |
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
I started with the following node creaton loop | |
for i in range(2): | |
tx.run(f"MERGE (:Node {{date: datetime('2018-06-01T{i:02}:00:00Z')}})") | |
tx.run(f"MERGE (:Node {{date: datetime('2018-06-01T{i:02}:00:00-01:00')}})") | |
Here is a TZ reference table | |
| UTC | -01:00 | | |
|-----|--------| | |
| 0 | 23 | |
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
mutex connCacheMutex; | |
map<string, weak_ptr<SftpConnection>> connCache; | |
std::shared_ptr<SftpConnection> getSftpConnForUri(const std::string & uri) | |
{ | |
string host = hostnameFromUri(uri); | |
auto it = connCache.find(host); | |
if (it != connCache.end()) { | |
if (auto conn = it->second.lock()) { | |
return conn; |
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
ext_id_it = db_session.query(Campaign) \ | |
.filter(Campaign.external_id | |
.in_(data['learn_from'])) |
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
# ref https://docs.python.org/2/library/string.html#string-formatting | |
from string import Formatter | |
class PassThroughFormatter(Formatter): | |
pass | |
ptf = PassThroughFormatter() | |
# works | |
s = "I am {name} and I am {age} years old" |
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
<?php | |
class Toto{ | |
function __construct(){ | |
print "CONSTRUCT!\n"; | |
} | |
function __destruct(){ | |
echo "DESTROY\n"; | |
} |
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
#pragma once | |
#include <city.h> | |
#include <sstream> | |
void michHashInternal(std::stringstream& ss){} | |
template<typename first, typename... args> | |
void michHashInternal(std::stringstream& ss, first&& f, args&&... a){ | |
ss << std::forward<first>(f); |
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
// script type | |
void save(BehaviourDomain & dom, const string & filename, ssize_t max) | |
{ | |
dom.save(filename, max); | |
} | |
// object type | |
void (BehaviourDomain::*save3)(const string &, ssize_t) = &BehaviourDomain::save; |
NewerOlder