Skip to content

Instantly share code, notes, and snippets.

Avatar

kik oelmekki

  • society
  • earth
View GitHub Profile
View ruby_check.vim
" File: ruby_check.vim
" Author: Olivier El Mekki
" Email: olivier@el-mekki.com
" Description: ruby syntax checks the buffer
" Usage:
" :RUBYCheck - lauch the syntax check
if exists('ruby_check_plugin')
finish
endif
View piwik.rb
# Allows to create event on piwik from server side code.
#
# Usage:
#
# piwik = Piwik.new
# piwik.create_event( category: 'sale', action: 'new_interface', name: '100_sales_from_same_country', value: 10_000 )
# piwik.create_event( name: 'user_changed_locale' )
#
#
# Required gems:
View 0001-ADD-tagline-in-slack-message.patch
From dc02b1cc6ec8b8c3c2693c1f91892e13bafefef8 Mon Sep 17 00:00:00 2001
From: Olivier El Mekki <olivier@el-mekki.com>
Date: Sun, 17 May 2015 19:18:32 +0200
Subject: [PATCH] ADD tagline in slack message
---
app/Console/Commands/PostUpvotes.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/Console/Commands/PostUpvotes.php b/app/Console/Commands/PostUpvotes.php
View test.rb
#!/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
View .irbrc
# ~/.irbrc
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
IRB.conf[:LOAD_MODULES] << 'irb/completion'
end
View env.rb
# 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
View Rakefile
require 'cucumber/rake/task'
def foo
puts "foo"
end
Cucumber::Rake::Task.new( :features ) do |t|
foo
end
View timetracker.vim
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")'
View env.rb
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)