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/ruby | |
require 'net/ftp' | |
require 'net/http' | |
require 'fileutils' | |
class String | |
def to_l(srcl,dstl) | |
val = gsub(/(["'\&\(\)])/) { "\\" + $1 } | |
`echo #{val} |iconv -f #{srcl} -t #{dstl}`.sub(/\n/,"") | |
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
#!/usr/bin/ruby | |
require 'thread' | |
require 'logger' | |
$KCODE = "utf-8" | |
class ProcMon < Logger::Application | |
def initialize() | |
super('ProcMon') # Name of the application. | |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
// Detection of an endianness in the run system. | |
int is_big_endian(void) | |
{ | |
union { | |
uint32_t i; | |
char c[4]; | |
} bint = {0x01020304}; | |
return bint.c[0] == 1; |
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
# function to convert an mp3 to an ogg file | |
function mp3_to_ogg { | |
mp3=$1 | |
wav=$(echo "$mp3"|sed "s/mp3$/wav/i") | |
ogg=$(echo "$mp3"|sed "s/mp3$/ogg/i") | |
artist=$(mp3info -p "%a\n" $mp3) | |
comment=$(mp3info -p "%c\n" $mp3) | |
genre=$(mp3info -p "%g\n" $mp3) | |
album=$(mp3info -p "%l\n" $mp3) | |
track=$(mp3info -p "%n\n" $mp3) |
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
gem 'koala' | |
gem 'bitly', '~> 0.8.0' | |
gem 'twitter' |
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
// THIS IS A BETA! I DON'T RECOMMEND USING IT IN PRODUCTION CODE JUST YET | |
/* | |
* Copyright 2012 Roman Nurik | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder