Skip to content

Instantly share code, notes, and snippets.

@ryrun
ryrun / ipmx.el
Last active August 29, 2015 14:15
get IP and MX of a domain with Emacs
; get ip and mx
(let ((domain "mydomain.com"))
(switch-to-buffer-other-window "*temp*")
(erase-buffer)
(setq www (format "www.%s" domain))
(setq ip "")
(setq mx "")
(setq ret-val (call-process "ping" nil t nil domain "-n" "1"))
(if (equal ret-val 0)
(progn
@ryrun
ryrun / PitchPhrases.lua
Last active December 19, 2015 19:39
create phrases for pitching (Renoise)
-- create phrases to pitch sample
-- get current insturment and selected sample
local instrIndex = renoise.song().selected_instrument_index
local smplIndex = renoise.song().selected_sample_index
local instr = renoise.song().instruments[instrIndex]
local basenote =instr.sample_mappings[renoise.Instrument.LAYER_NOTE_ON][smplIndex].base_note
-- how many steps
local steps = 12
@ryrun
ryrun / avenger_vstpreset_gen.php
Created February 16, 2017 19:10
Convert VST Avenger .avgr Patches to VSTi patches .fxp in PHP
<?php
$path = ""; //add your avenger expansion path here
$dir = scandir( $path );
$dir = array_diff($dir,["." , ".." ]);
//all expansions
foreach($dir as $exp) {
$presetpath = $path . $exp . "\\presets\\";
$presettypes = scandir($presetpath);
@ryrun
ryrun / avenger_vstpreset_gen.el
Created February 18, 2017 21:09
Convert VST Avenger presets to fxp with emacs elisp
(require 'bindat)
;;; put your avengers content path here
(setq avenger-content-path "")
(mapcar (lambda (filename)
;; show current patch in message buffer
(message filename)
;; read file
@ryrun
ryrun / gist:c6817b8c76d2a43ef670bd2c2e25a73a
Created June 19, 2017 07:04
Simple fix for sha1 error, when using git on samba shares
git config --add core.createobject link
@ryrun
ryrun / randomsteamwallpaper.cmd
Created August 20, 2017 16:36
Use a random steam screenhot as desktop background
@echo off
rem Initialize values
set /A a=16807, s=40
rem APA Modification: use current centiseconds for initial value
for /F "tokens=2 delims=," %%a in ("%time%") do if "%%a" neq "00" set /A s=1%%a %% 100
setlocal EnableDelayedExpansion
rem replace *** witht the correct numbers, where the screenshots are located
@ryrun
ryrun / simple_openproject_api_calls.php
Created February 12, 2020 08:29
Using OpenProject API in PHP, some exmaples
<?php
/**
The current openproject api is missing some exmaples. This is what i got working in PHP.
*/
function _request( $req, $postdata = false, $requesttype = 'POST' )
{
$ch = curl_init();
if ( preg_match( '~^/api/v3(.*)~', $req, $temp ) ) {
$req = $temp[ 1 ];
}
@ryrun
ryrun / autoreload.js
Last active March 3, 2020 10:15
Simple auto reload page on change, Live edit / Live preview
//pretty dirty autoreload script
var lastMod = [];
var files = [window.location.href];
var countReq = 0;
var hidden = false;
function __autoreload() {
var checkfiles = true;
if (document.hasFocus()) {
checkfiles = false;
@ryrun
ryrun / noteoff2.lua
Created October 17, 2020 17:22
protplug midi script: "note tie", delay note offs till next note on event
require "include/protoplug"
lastoff = 0
function plugin.processBlock(samples, smax, midiBuf)
playEvents = {}
for ev in midiBuf:eachEvent() do
if ev:isNoteOn() and ev:getNote() ~= lastoff and lastoff>0 then
table.insert(playEvents, midi.Event(ev))
table.insert(playEvents, midi.Event.noteOff(
@ryrun
ryrun / midi-drone-note.lua
Last active April 17, 2021 16:49
Midi script for VST protoplug for "drone" notes
require "include/protoplug"
noteOn = 0
function plugin.processBlock(samples, smax, midiBuf)
blockEvents = {}
-- drone note, 72 = C
local rootNote = 69
for ev in midiBuf:eachEvent() do