Skip to content

Instantly share code, notes, and snippets.

View oelmekki's full-sized avatar

kik oelmekki

View GitHub Profile
test of gist.vim
#!/usr/bin/env ruby
require 'socket'
Host = 'google.com'
Port = 80
socket = TCPSocket.new( Host, Port )
socket.puts "GET /"
socket.readlines.each do |line|
p line
end
# ~/.irbrc
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
IRB.conf[:LOAD_MODULES] << 'irb/completion'
end
# in order to be able to do in step definitions :
# webrat_session.page.should have_selector( css3_selector )
module WWW
class Mechanize
class Page
def has_selector?( selector )
not search( selector ).empty?
end
end
end
require 'cucumber/rake/task'
def foo
puts "foo"
end
Cucumber::Rake::Task.new( :features ) do |t|
foo
end
if exists('trackloaded')
finish
endif
" list of autocmd events:
" http://www.vim.org/htmldoc/autocmd.html#autocmd-events
let trackfile = '/tmp/timetrack.dat'
let trackloaded = 1
execute 'autocmd InsertEnter * call Track("begin")'
require 'spec'
require 'rubygems'
require 'webrat'
require "#{File.dirname(__FILE__)}/logger"
# default object is the session object
def method_missing(name, *args, &block)
if webrat_session.respond_to?(name)
webrat_session.send(name, *args, &block)
(function($)
{
/**
* Get a cookie
* @param string
* @return string
*/
function getCookie( name )
{
var nameEQ = name + "=";
(function($)
{
/**
* Get a cookie
* @param string
* @return string
*/
function getCookie( name )
{
var nameEQ = name + "=";
" File: tab_alternate.vim
" Author: Olivier El Mekki
" Email: [email protected]
" Description: script allow to switch to the last seen tab, as the screen C-a a
" Usage:
" :Tabalter - go to the last seen tab
if exists('tab_alternate_plugin')
finish
endif