Skip to content

Instantly share code, notes, and snippets.

@aruslan
aruslan / shodan-blurb.txt
Created January 12, 2020 01:54
shodan-blurb.txt
Нам нужны бойцы.
Не вертикальные вонючие лужи, не "программисты С/С++".
Бойцы.
Настоящий сиплюсплюс не прощает.
Выглядит как игрушка, что девочка забыла на лужайке.
Но потом горят боевые корабли на подступах к Ориону.
С Шоданом я спокоен за бойцов и их боевой оскал.
Потому что Шодан учит главному: убивать, и любить свою винтовку.
Шодан учит сиплюсплюсу.
(ц) Руслан Абдикеев, Sr. Director of Engineering at Electronic Arts (EA)

Keybase proof

I hereby claim:

  • I am aruslan on github.
  • I am aruslan (https://keybase.io/aruslan) on keybase.
  • I have a public key ASCTSV8qSdgMtHjNi8Qul0QMjVCJJi4R9hoOVscURE4iUAo

To claim this, I am signing this object:

@aruslan
aruslan / ziptest.cc
Created June 19, 2018 02:42
an example of zip for N.K.
#include <iostream>
#include <iterator>
#include <tuple>
template <typename C1, typename C2>
struct zip_container {
C1& c1; C2& c2;
typedef std::tuple<
decltype(std::begin(c1)), decltype(std::begin(c2))
> tuple;
@aruslan
aruslan / cpptestsol-locale-unaware.cc
Last active February 26, 2017 23:54
locale-unaware solution to cpp test
#include <algorithm>
#include <codecvt>
#include <fstream>
#include <iostream>
#include <locale>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
@aruslan
aruslan / binary_search_speedup.cc
Last active September 30, 2016 12:24
Ruslan's binary search padding effect demo
// Demo of the binary search padding effect ("+30% performance")
// 2008-2016 (C) Ruslan Abdikeev
//
// This is free and unencumbered software released into the public domain.
// I dedicate any and all copyright interest in this software to the
// public domain. I make this dedication for the benefit of the public at
// large and to the detriment of my heirs and successors. I intend this
// dedication to be an overt act of relinquishment in perpetuity of all
// present and future rights to this software under copyright law.
@aruslan
aruslan / non_intrusive_serialization_example.cc
Created July 7, 2016 19:34
For tilarids: an example of a simple serialization with no changes to serializable structs.
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <utility>
//------------ ORIGINAL CODE.
// a.h - NO CHANGES, verbatim
// should be serializable. -- MAY NEED TO ADD SOME [[*]] ATTRIBUTE.
class A {
@aruslan
aruslan / simpleSfinae.cc
Created July 5, 2016 15:10
For Pavel Ilin
#include <utility>
template <typename T>
auto func(T& t) -> decltype(std::declval<T>().method(), bool())
{
return t.method();
}
bool func(int& i) { return 42; }
class Name
{
static class name { public name(name name) {} };
public static void name()
{
name name = null;
name = new name(name);
}
}
function name(name) {
this.name = name;
}
var name = new name("name");
struct name { int name; };
int name(struct name name) {
name: return name.name;
}
#define name(name,ame) name##ame
enum { name(name,name) };
int main() { return namename; }