Skip to content

Instantly share code, notes, and snippets.

@Houdini
Houdini / facebook.rb
Created April 21, 2011 09:20
facebook connection with oauth2 gem. Works under 1.9.2 and error in ruby 1.8.7
require 'rubygems'
# require 'faraday'
# module Faraday
# class Adapter < Middleware
# def call(env)
# env[:ssl][:verify] = false if env[:ssl]
# process_body_for_request(env)
# end
@Houdini
Houdini / brew install libwmf
Created April 19, 2011 23:12
ENV.j1 is right after def install
~/my_ruby $ brew install libwmf
==> Downloading http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz
File already downloaded and cached to /Users/houdini/Library/Caches/Homebrew
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libwmf/0.2.8.4 --with-freetype=/usr/X11
==> make
make all-recursive
Making all in .
make[2]: Nothing to be done for `all-am'.
Making all in src
Making all in extra
~/my_ruby $ brew install libwmf
==> Downloading http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz
File already downloaded and cached to /Users/houdini/Library/Caches/Homebrew
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libwmf/0.2.8.4 --with-freetype=/usr/X11
==> make
make all-recursive
Making all in .
make[2]: Nothing to be done for `all-am'.
Making all in src
Making all in extra
1 require 'formula'
2
3 class Libwmf < Formula
4 url 'http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz'
5 homepage 'http://wvware.sourceforge.net/libwmf.html'
6 md5 'd1177739bf1ceb07f57421f0cee191e0'
7
8 depends_on 'pkg-config' => :build
9 depends_on 'gd'
10
~/my_ruby $ brew install libwmf
==> Downloading http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz
File already downloaded and cached to /Users/houdini/Library/Caches/Homebrew
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libwmf/0.2.8.4 --with-freetype=/usr/X11
==> make
make all-recursive
Making all in .
make[2]: Nothing to be done for `all-am'.
Making all in src
Making all in extra
~/RubymineProjects/do_admin (master) $ brew install mysql
==> Downloading http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.10.tar.gz
File already downloaded and cached to /Users/houdini/Library/Caches/Homebrew
==> Downloading patches
==> Patching
patching file scripts/mysqld_safe.sh
Hunk #1 succeeded at 555 (offset 172 lines).
patching file scripts/mysql_config.sh
Hunk #1 succeeded at 137 (offset 5 lines).
==> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.10 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/mysql/5.5.10/share/man -DINSTALL_DOCDIR=/us
~/RubymineProjects/fun-images (master) $ brew install libwmf ==> Downloading http://downloads.sourceforge.net/project/wvware/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz File already downloaded and cached to /Users/houdini/Library/Caches/Homebrew
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/libwmf/0.2.8.4 --with-freetype=/usr/X11 ==> make make all-recursive
Making all in .
make[2]: Nothing to be done for all-am'. Making all in src Making all in extra Making all in trio make[4]: Nothing to be done forall'.
Making all in gd
/bin/sh ../../../libtool --mode=compile --tag=CC /usr/bin/cc -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_LIBFREETYPE -DHAVE_LIBPNG -I. -I. -I../../.. -I. -I/usr/X11R6/include -O3 -w -pipe -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/X11/include -c -o gd.lo gd.c /bin/sh ../../../libtool --mode=compile --tag=CC /usr/bin/cc -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_LIBFREETYPE -DHAVE_LIBPNG -I. -I. -I../../.. -I. -I/usr/X11R6/include -O3 -w -pipe -I/usr/X11
@Houdini
Houdini / Округление.rb
Created February 4, 2011 21:47
Это тест разных видов округллений и их комбинаций при валютном обмене
def round_math a
(a*100).round.to_f/100
end
def ceil_math a
(a*100).ceil.to_f/100
end
def floor_math a
- (String) highlight_text:input_string {
return input_string
if (search_string !== '') {
var regex = new RegExp(search_string, 'ig');
var start_index = input_string.search(regex);
var new_substring = '<strong>' + input_string.substring(start_index, search_string.length) + '</strong>';
return input_string.substring(0, start_index) + new_substring + input_string.substring(search_string.length + start_index, input_string.length);
} else {
return '';
}
- (String) highlight_text:(String)input_string {
if (search_string !== '') { //search_string id defined before
var regex = new RegExp(search_string, 'ig');
var start_index = input_string.search(regex);
var new_substring = '<strong>' + intput_string.substring(start_index, search_string.length) + '</strong>';
return input_string(0, start_index) + new_substring + input_string(search_string.length + start_index, input_string.length);
} else {
return '';
}
}