Skip to content

Instantly share code, notes, and snippets.

Pavlo Ilin PIlin

  • Frankfurt
Block or report user

Report or block PIlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View template_func_detection2.cpp
#include <iostream>
template <typename T>
void func(T& t)
{
t.method();
}
struct A { void method() { std::cout <<"a"; } };
struct B { int justSomeValue; };
View templ_func_serialization.cpp
#include <iostream>
template <typename T>
void func(T& t)
{
t.method();
}
struct A { void method() { std::cout <<"a"; } };
struct B { int justSomeValue; };
View crtp.cpp
#include <iostream>
using namespace std;
template <typename T, typename U>
struct Base
{
void TestBase(void* ptr) //__attribute__ ((noinline))
{
U& ref = *reinterpret_cast<U*>(ptr);
static_cast<T*>(this)->Test(ref);
View gcc_sfinae_issue.cpp
#include <iostream>
#include <type_traits>
template<class T> class HasTypeTag {
// This version doesn't work as intended in GCC
template<class C> static std::true_type test(char[sizeof(C::TypeTag)]);
// This version works in GCC, Clang and VS2013
//template<class C> static auto test(void*) -> decltype(C::TypeTag, std::true_type());
template<class C> static std::false_type test(...);
public:
View aligned_storage
template <int A> struct aligned;
template <> struct __declspec(align(1)) aligned < 1 > {};
template <> struct __declspec(align(2)) aligned < 2 > {};
template <> struct __declspec(align(4)) aligned < 4 > {};
template <> struct __declspec(align(8)) aligned < 8 > {};
template <> struct __declspec(align(16)) aligned < 16 > {};
template <> struct __declspec(align(32)) aligned < 32 > {};
template <int size, int align>
union aligned_type {
View gist:7671239
struct Node
{
Node* child;
};
// void gatherDescendants(std::vector<Node*>& target, Node* root)
// {
// if (root->child)
// {
// target.push_back(root->child);
View PKGBUILD
# Maintainer: Pavlo Ilin <ilin.pa@gmail.com>
pkgname=gigolo-git
pkgver=gigolo.0.4.1.r300.g3a68461
pkgrel=1
epoch=
pkgdesc="Frontend to manage connections to remote filesystems using GIO/GVFS"
arch=(i686 x86_64)
url="http://goodies.xfce.org/projects/applications/gigolo"
license=('GPL2')
groups=('xfce4-git')
View PKGBUILD
pkgname=latex-pscyr
pkgver=0.4d.beta9
pkgrel=2
pkgdesc='Cyrillyc fonts package for (La)TeX'
arch=(any)
url=http://www.lisin.ru/2008/10/17/download-pscyr/
license=(GPL)
install=pscyr.install
depends=(texlive-core)
source=(
@PIlin
PIlin / dircolors_pprint.py
Created Jun 9, 2013
Print dircolors file (or dircolors -p output) with the configured colors
View dircolors_pprint.py
import shlex
from subprocess import Popen, PIPE
import re
from pprint import pprint
import sys
from sys import stdout
from sys import argv
@PIlin
PIlin / ino_compile_options.py
Created Jan 26, 2013
This script is analogue of this script for cmake (https://gist.github.com/4641812), but it works with ino tool for arduino.
View ino_compile_options.py
# Get file compile ooptions from ino database
#
# Usage within SublimeClang:
# "sublimeclang_options_script": "python ${project_path:ino_compile_options.py}",
# "sublimeclang_options":
# [
# "-Wno-attributes",
# "-Wno-builtin-requires-header",
# "-Wno-unused-command-line-argument"
# ]
You can’t perform that action at this time.