Skip to content

Instantly share code, notes, and snippets.

@kl
kl / requirevx.rb
Created August 4, 2012 10:25
Implements require and load for RPG Maker VX
module RequireVXConfig
#
# -Configure options here-
#
# What they do:
#
# :make_default_load_paths
# Initializes the $LOAD_PATH variable to it's default values (not the
# paths that are used to require C files becauset hey will not work).
# If this is done the Ruby standard library can be copy/pasted
# TODO: extract_download_url_entries fails some times because stream_map is nil. why?
# TODO: sometimes get permission denied. it seemed that the itag value got concatenated to the end of the
# download url (removing it makes it work again). not sure how that is possible.
require "pry"
class YoutubeNew < PluginBase
VIDEO_INFO_URL = "http://www.youtube.com/get_video_info?video_id="
@kl
kl / gist:5760030
Created June 11, 2013 19:51
RPG Maker VX Ace run common event on state removal
module StateRemoveCommonEventsKal
TAG_NAME = "srce"
class IDExtractor
def get_common_event_id_for_state(state_id)
rpg_state = get_rpg_state(state_id)
extract_common_event_id(rpg_state.note)
end
@kl
kl / equippictures.rb
Last active December 18, 2015 13:09
RPG Maker VX Ace show equip item pictures instead of stats
#
# KalEquipPictures 1.0 by Kal
# ---------------------------
# Changes the equip status window to display an item picture.
# Usage: First import you pictures to the Graphics/Pictures folder.
# Then in the item note box but a tag like this: <TAG_NAME filename>
# Example: <image sword01.png>
#
module KalEquipPictures
@kl
kl / battle_positions.rb
Created June 19, 2013 15:52
Version p1
module BattlePositionsKal
SKILL_ID = 200
ENEMY_START = 0
PARTY_START = 10
ENEMY_INC = 2
DEFAULT_SKILL_RANGE = 1
FONT_COLOR = "1ACDE8"
end
@kl
kl / yotsubato.rb
Last active December 19, 2015 15:28
Yotsubato TTS downloader
#encoding: utf-8
require 'fileutils'
require 'open-uri'
require 'sanitize'
#require 'pry'
class YotsubatoDownloader
API = ARGV[1] || "http://208.109.168.116/GetAudio1.ashx?speaker=302&content="
package miun.se.ant;
import com.dsi.ant.message.ChannelId;
import com.dsi.ant.message.ChannelType;
public class DefaultChannelParameters {
public static final ChannelType TYPE = ChannelType.BIDIRECTIONAL_SLAVE;
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Event [
<!ELEMENT Event (EventName, Race*)>
<!ELEMENT Race (RaceNumber, RaceDistance, RaceComment?, Horse*)>
<!ELEMENT EventName (#PCDATA)>
<!ELEMENT RaceNumber (#PCDATA)>
<!ELEMENT RaceDistance (#PCDATA)>
<!ELEMENT RaceComment (#PCDATA)>
<!ELEMENT Horse (HorseName, Teamster, HorseComment?)>
@kl
kl / .vimrc
Created November 6, 2013 12:49
vimrc
execute pathogen#infect()
autocmd vimenter * if !argc() | NERDTree | endif
set expandtab
set hidden
set number
set shiftwidth=2
set softtabstop=2
@kl
kl / .tmux.conf
Last active February 21, 2020 08:37
tmux.conf
# Enable 256 color mode
set -g default-terminal "screen-256color"
# Disable mouse
set -g mouse off
# Set the prefix from C-b to C-a
set -g prefix C-a
unbind C-b