Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Vasil ptrv

View GitHub Profile
@ptrv
ptrv / gist:9299567
Created Mar 1, 2014
audio plugin parameter conversion
View gist:9299567
float convertToHost (float val, float min, float max)
{
float range = (max) - (min);
val= (val - min)/range;
return val;
}
float convertFromHost (float val,float min,float max)
{
float range = (max) - (min);
@ptrv
ptrv / ediff
Created May 23, 2014
run ediff in emacsclient
View ediff
#!/bin/bash
# test args
if [ ! ${#} -ge 2 ]; then
echo 1>&2 "Usage: ${0} LOCAL REMOTE [MERGED BASE]"
echo 1>&2 " (LOCAL, REMOTE, MERGED, BASE can be provided by \`git mergetool'.)"
exit 1
fi
# tools
View compdb2clang_complete.py
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
CONFIG_NAME = ".clang_complete"
def readConfiguration():
try:
f = open(CONFIG_NAME, "r")
View ediff
#!/bin/bash
# test args
if [ ! ${#} -ge 2 ]; then
echo 1>&2 "Usage: ${0} LOCAL REMOTE [MERGED BASE]"
echo 1>&2 " (LOCAL, REMOTE, MERGED, BASE can be provided by \`git mergetool'.)"
exit 1
fi
# tools
View mocked_require.lua
local lua_require = require
function require(mod_name)
if package.preload[mod_name] == nil then
package.preload[mod_name] = function()
local filename = of.toDataPath("scripts/"..mod_name..".lua", true)
local fn = loadfile(filename)
return fn()
end
end
@ptrv
ptrv / anonymous-gist.el
Created Oct 26, 2014
Emacs company-ycmd config
View anonymous-gist.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; * ycmd
(ptrv/after cc-mode
(message "Load config: ycmd...")
(require 'ycmd)
(defun ptrv/company-ycmd--init ()
(local-set-key (kbd "<f12>") 'company-complete-common)
(make-local-variable 'company-backends)
(company-ycmd-setup))
@ptrv
ptrv / config
Created Dec 21, 2014
terminator terminal config with zenburn colors
View config
[global_config]
enabled_plugins = APTURLHandler, LaunchpadCodeURLHandler, LaunchpadBugURLHandler
title_transmit_bg_color = "#000000"
title_inactive_bg_color = "#000000"
[keybindings]
hide_window = None
[profiles]
[[default]]
scrollbar_position = hidden
term = xterm-256color
@ptrv
ptrv / cyberpunk-ptrv.el
Created Feb 18, 2015
modified emacs-live default theme
View cyberpunk-ptrv.el
;; Cyberpunk Colour Theme
;;
;; "and he'd still see the matrix in his sleep, bright lattices of logic
;; unfolding across that colorless void..."
;; William Gibson, Neuromancer.
;;
(require 'color-theme)
;;;###autoload
@ptrv
ptrv / lookup_ip_address_by_user_defined_ethernet_name.mm
Created Feb 26, 2015
Lookup IP Address by User Defined Ethernet Name on Mac OS X
View lookup_ip_address_by_user_defined_ethernet_name.mm
//
// includes
//
#import <SystemConfiguration/SystemConfiguration.h>
#import <CoreFoundation/CoreFoundation.h>
#import <arpa/inet.h>
#import <string>
//
// desc: convert IPv4 address from binary format to numbers-and-dots notation in a string
View testå.cpp
#include <string>
/* this is a test: åøæ */
namespace {
int føø(const std::string& x) {
}
You can’t perform that action at this time.