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 | |
# Simple script which can be used with couchapp to automatically | |
# push applications to couchdb on files update on systems supporting inotify. | |
# | |
# First install rubygems in your system, then: | |
# | |
# $ sudo gem install rb-inotify | |
# $ cd couchapp_project | |
# $ ./couchapp_updater |
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
Selenium::WebDriver::Error::InvalidSelectorError: | |
The given selector "./descendant-or-self::*[contains(normalize-space(.), 'Who are you? Question number 1')] is either invalid or does not resultin a Webelement. The following error occurred: | |
[InvalidSelectorError] Unable to locate elements with the xpath expression ./descendant-or-self::*[contains(normalize-space(.), 'Who are you? Question number 1')] because of the following error: | |
[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMXPathEvaluator.createNSResolver]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://fxdriver/modules/atoms.js :: <TOP_LEVEL> :: line 2360" data: no] | |
# [remote server] file:///tmp/webdriver-profile20110824-22465-be82oi/extensions/[email protected]/components/driver-component.js -> file:///tmp/webdriver-profile20110824-22465-be82oi/extensions/[email protected]/components/firefoxDriver.js:466:in `unknown' | |
# [remot |
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
# Copy it to fnordmetric directory and run with | |
# | |
# bundle exec ruby -Ilib -I. populate.rb live | |
# | |
# to generate fake current traffic or | |
# | |
# bundle exec ruby -Ilib -I. populate.rb past | |
# | |
# to generate fake stats for last month. | |
# |
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
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' |
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
! Add right alt to control group | |
clear mod5 | |
keycode 108 = Control_R | |
add control = Control_R | |
! Remap mail to page up and caps to page down | |
keycode 66 = Next | |
keycode 163 = Prior |
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
(fn [n] (->> | |
(range 2 n) | |
(filter (fn [x] | |
(not (some #(and (= 0 (rem x %)) (= 0 (rem n %))) (range 2 (inc x)))))) | |
count | |
inc)) |
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 | |
require 'socket' | |
ADDRESS = '127.0.0.1' | |
PORT = 8673 | |
FILTER_NAME = 'filter_crasher' | |
20.times do |i| |
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 'httparty' | |
Array.new(32) {|i| i}.map do |worker| | |
fork do | |
file = File.open("worker_#{worker}.log", "w") | |
1000.times do |i| | |
url = "http://localhost:9290/tests/test1.txt" | |
page = HTTParty.get(url) | |
file.puts("==============") | |
file.puts("url: #{url}") |
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
const Gio = imports.gi.Gio; | |
let file = Gio.File.new_for_path('file.txt'); | |
stream = file.replace(null, false, null, null, null); | |
let str = 'hello Kacper :)'; | |
stream.write(str, null, null, null); | |
stream.close(null); |
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
Using /home/kazjote/.rvm/gems/ruby-1.9.3-p327 | |
➜ threads time ruby threads.rb 1 | |
ruby threads.rb 1 0.02s user 0.01s system 0% cpu 10.054 total | |
➜ threads time ruby threads.rb 2 | |
ruby threads.rb 2 0.02s user 0.02s system 0% cpu 6.049 total | |
➜ threads time ruby threads.rb 4 | |
ruby threads.rb 4 0.01s user 0.02s system 0% cpu 4.040 total | |
➜ threads time ruby threads.rb 8 | |
ruby threads.rb 8 0.02s user 0.02s system 1% cpu 3.037 total | |
➜ threads time ruby threads.rb 16 |
OlderNewer