Skip to content

Instantly share code, notes, and snippets.

View Orphist's full-sized avatar
🏠
Working from home

Max Surkov Orphist

🏠
Working from home
View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
=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')
@Orphist
Orphist / bitset.rb
Created February 24, 2014 05:22 — forked from mattetti/bitset.rb
redis sets
require 'hiredis'
require "redis/connection/hiredis"
require 'redis'
$redis = Redis.new(:host => "127.0.0.1", :port => 6379)
unless $redis.exists 'SanDiego'
puts "Creating 35 million entries"
start = Time.now
idx = 0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.edb.launchd.postgresql-9.1</string>
<key>ProgramArguments</key>
'''
redis_search.py
Written by Josiah Carlson July 3, 2010
Released into the public domain.
This module implements a simple TF/IDF indexing and search algorithm using
Redis as a datastore server. The particular algorithm implemented uses the
redis-search 0.3 Benchmark
Core 2 Duo CPU 2.66G, 4G Memory
20W 数据
# coding: utf-8
require "benchmark"
["的","美丽","云","云儿","花","云儿的"].each do |key|
@Orphist
Orphist / gist:17df0372ae7f619b2872
Created June 10, 2014 05:25
Installing Virtual Box and Vagrant on Mac OS X
Installing Virtual Box and Vagrant on Mac OS X
kyolee310 edited this page on Jul 11, 2013 · 10 revisions
Pages 9
Creating a New Vagrant Package Image
Description of Selenium IDE test cases
Eucalyptus UI Team Branch Post Commit Checklist
Guidelines to contributing to se34euca project
Home
How to debug and fix a selenium IDE test
require 'amqp'
module HiringThingEM
def self.start
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
# for passenger, we need to avoid orphaned threads
if forked && EM.reactor_running?
EM.stop
end
Thread.new {
=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')
Collection of oneliner music formulas. Version 2011-10-18
I've tried to collect all the formulas in the related threads etc.
(excluding those that clearly sound like random first experiments or total
crap; when several variants are available, i've chosen the shortest one)
If you think I've missed something that should be here, please let me know.
====== 1ST ITERATION ======