Skip to content

Instantly share code, notes, and snippets.


Peter Vasil ptrv

View GitHub Profile
nilsdeppe /
Last active Jan 3, 2019
A Python script used by to provide code completion in header files.
#!/bin/env python
# Copyright Nils Deppe, 2017
# Distributed under the Boost Software License - Version 1.0
# Boost Software License - Version 1.0 - August 17th, 2003
# Permission is hereby granted, free of charge, to any person or organization
# obtaining a copy of the software and accompanying documentation covered by
# this license (the "Software") to use, reproduce, display, distribute,
nikital / company-insert-selected.el
Last active Sep 7, 2017
View company-insert-selected.el
;;; company-insert-selected.el
;; Similar to the way neocomplete package from Vim deals with autocompletion
(defvar-local company-insert-selected--overlay nil)
(defun company--company-command-p (keys)
"Checks if the keys are part of company's overriding keymap"
(or (equal [company-dummy-event] keys)
aceontech / RetainCycleUnitTest.swift
Created Mar 3, 2017
Unit test for checking for retain cycles in Swift. Replace `CLASS_YOU_WANT_TO_TEST` with your class name.
View RetainCycleUnitTest.swift
func testCleanup() {
// Extend your class inline in order to add closure property `deinitCalled`,
// which indicates when/if your class's deinit() gets called
class ClassUnderTest: CLASS_YOU_WANT_TO_TEST {
var deinitCalled: (() -> Void)?
deinit { deinitCalled?() }
// Set up async expectation, which causes the test to wait for `deinitCalled`

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

VictorLaskin / NamedTuple.h
Last active Jul 16, 2020
Named tuple for C++
View NamedTuple.h
// Named tuple for C++
// Example code from
// Written by Victor Laskin (
// Parts of code were taken from:
namespace foonathan {
namespace string_id {
namespace detail
cevaris /
Created Nov 22, 2015
Mac OSX tmux emacs copy & paste configuration
$ brew install reattach-to-user-namespace
camdez / breaktime.el
Last active Aug 29, 2015
/u/joeheyming's Emacs break timer (modified)
View breaktime.el
;;; See:
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-interval (* 3 60 60)
"How often to take a break, in seconds.")
(defun breaktime--take-a-break ()
(switch-to-buffer (get-buffer-create "*breaktime*"))
(let ((inhibit-read-only t))
nphyx / terminalrc
Last active Jul 30, 2017 — forked from jlhg/terminalrc
Zenburn colours scheme for Xfce Terminal
View terminalrc
# Zenburn colours scheme for Xfce Terminal updated for Xfce4-terminal 0.6.3. Copy and paste the following in ${HOME}/.config/xfce4/Terminal/terminalrc:
You can’t perform that action at this time.