Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ptrv
ptrv / gist:9299567
Created March 1, 2014 23:56
audio plugin parameter conversion
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 21:00
run ediff in emacsclient
#!/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
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
CONFIG_NAME = ".clang_complete"
def readConfiguration():
try:
f = open(CONFIG_NAME, "r")
#!/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
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 October 26, 2014 21:47
Emacs company-ycmd config
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; * 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 December 21, 2014 00:13
terminator terminal config with zenburn colors
[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
#include <string>
/* this is a test: åøæ */
namespace {
int føø(const std::string& x) {
}
# svn recipes by http://github.com/htxt
# Remove deleted files
svn status | grep '\!' | awk '{print $2;}' | xargs svn rm
# Add all new files
svn add * --force
# Recursively remove .svn directories
rm -rf `find . -type d -name .svn`
# Tar a subversion working copy...without all those hidden directories!
tar --exclude='.svn' -c -f /path/to/file.tar /path/to/directory