This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
require "rubygems" | |
require "stringex" | |
module Asciiable | |
def method_missing(method, *args) | |
return self.send(Regexp.last_match(1)).to_s.to_ascii if(method.to_s=~/(.+)_ascii/) | |
super | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'roo' # Надо установить библиотеку `gem install roo` | |
# Мне потребовалось дорешать зависимости руками: `gem install bones builder zip nokogiri spreadsheet google-spreadsheet-ruby spreadsheet-excel` | |
xls = Excel.new('http://www.nalog.ru/html/docs/svot/1nm2010.xls') # Эта строка автоматом загрузит xls-файл из веба и распарсит его в структуру | |
14.upto(22) do |line| | |
3.upto(7) do |cell| | |
print "#{xls.cell(line, cell)}\t" # Выведет фрагмент документа - строки с 14 по 22, колонки с 3 по 7 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Original code by Carlos Tirado, http://www.ruby-forum.com/topic/99742#214485 | |
require 'win32ole' | |
word = WIN32OLE.new('word.application') | |
word.visible = true | |
word.documents.count | |
# open/create new document | |
word.documents.add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'pdf/toolkit' # Для работы требует pdftk и xpdf - в debain они доступны из пакетов | |
my_pdf = PDF::Toolkit.open("DrakonDescription.pdf") | |
text = my_pdf.to_text | |
text.each_line do |line| | |
puts line | |
end | |
# Выводит текстовое содержимое файла построчно. Русский переваривает нормально. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$KCODE = 'UTF8' | |
require 'rubygems' | |
require 'mechanize' | |
require 'docsplit' | |
require 'fastercsv' | |
a = Mechanize.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iozone -ec -t10 -r64K -s512K -i0 -F Z:\iozone\file01 Z:\iozone\file02 Z:\iozone\file03 Z:\iozone\file04 Z:\iozone\file05 Z:\iozone\file06 Z:\iozone\file07 Z:\iozone\file08 Z:\iozone\file09 Z:\iozone\file10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Automatically generated make config: don't edit | |
# Linux kernel version: 2.6.29-5f084974 | |
# Tue Aug 17 18:32:46 2010 | |
# | |
CONFIG_ARM=y | |
CONFIG_SYS_SUPPORTS_APM_EMULATION=y | |
CONFIG_GENERIC_GPIO=y | |
CONFIG_GENERIC_TIME=y | |
CONFIG_GENERIC_CLOCKEVENTS=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
class Direction { | |
private static const CREATE:Object = {}; | |
/* | |
* The actual enumeration values. Note that the sorting order doesn't matter. | |
*/ | |
public static const NONE:Direction = new Direction(CREATE); | |
public static const UP:Direction = new Direction(CREATE); | |
public static const DOWN:Direction = new Direction(CREATE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPO_ROOT=/srv/repo | |
PACKAGES_LOCATION=pool | |
METAINFO_LOCATION=$REPO_ROOT/dists/ubuntu/ | |
RELEASE_FILE=$METAINFO_LOCATION/Release | |
PACKAGES_FILE=$METAINFO_LOCATION/testing/binary-amd64/Packages | |
cd $REPO_ROOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_NAME:=ets_cache | |
UPSTREAM_GIT:=https://github.com/blinkov/ets-cache.git | |
UPSTREAM_REVISION:=96e9a2a7c16127b8f4d0bdb279e28bd5600e4265 | |
RETAIN_ORIGINAL_VERSION:=true | |
ORIGINAL_APP_FILE=$(CLONE_DIR)/src/$(APP_NAME).app.src | |
DO_NOT_GENERATE_APP_FILE=true |
OlderNewer