- * any string
- ? any single character
- [abc..] match one of enclosed characters
- [!abc..] match any characters not enclosed
- ~ home dir
- ~user user home 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 <sstream> | |
#include <benchmark/benchmark.h> | |
using namespace std; | |
static void BM_bench01(benchmark::State& st) { | |
while (st.KeepRunning()) { | |
std::stringstream s; | |
for (size_t i = 0; i < st.range(0); i++) { |
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
""" | |
rsyslog config: /etc/rsyslog.d/my-sample.conf: | |
$template AppLogFormat, "%TIMESTAMP:::date-pgsql%%TIMESTAMP:27:32:date-rfc3339%(%syslogseverity-text%)%msg%\n" | |
if $app-name == 'my-sample-app' then -/var/log/my-sample-app/app.log;AppLogFormat | |
& ~ | |
""" | |
from __future__ import print_function |
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
# vim | |
:set number | |
:syn on | |
~/.vimrc: https://github.com/danielkraic/dotfiles/blob/master/vimrc | |
## files | |
vim file | |
vim +10 file |
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 <memory> | |
#include <mutex> | |
// ScopedResource: resource with mutex (acquire resource in constructor, release in destructor) | |
template <class T> | |
class ScopedResource { | |
public: | |
ScopedResource(std::pair<T*, std::mutex&> resource) | |
: d_resource(resource.first), |
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
db.data.drop() | |
db.data.insertOne({"name": "val1"}) | |
db.data.insertOne({"_id": "id100", "name": "val1"}) | |
db.data.insertMany([ | |
{ "name": "val1" }, | |
{ "name": "val2" } | |
] | |
) |
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
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0,allocate/0,deallocate/1,stop/0,clear/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
# deprecated_route.py | |
registered_deprecated_routes = set() | |
register_deprecated_routes = True | |
def is_deprecated(route): | |
return route in registered_deprecated_routes | |
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
short val = 12; | |
// check if bit is set: | |
if (val & 0b0010) return true; | |
// ensure bit is 1: | |
val = val | 0b0010; | |
// ensure bit is o: | |
val = val & ~0b0010; |
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
p, .entry-content, .gallery-caption { | |
font-size: 14px; | |
} | |
.entry-content, .entry-summary { | |
padding: 0 5% 5%; | |
} | |
.site { | |
max-width: 1600px; |
OlderNewer