Skip to content

Instantly share code, notes, and snippets.

View pete-otaqui's full-sized avatar

Pete Otaqui pete-otaqui

View GitHub Profile
@pete-otaqui
pete-otaqui / env.rb
Created September 15, 2011 15:48
env.rb for cucumber ... with fixtures in a mysql database
=begin
Environment variables you can set:
MHT_HOST=domain.com ... the host to test, default is www.mangahigh.com
MHT_DRIVER='mechanize' ... default capybara driver to use, valid values are:
mechanize,
celerity,
chrome,
culerity,
selenium,
@pete-otaqui
pete-otaqui / fake_console.js
Created September 22, 2011 08:59
Fake Firebug API, allows safe use of Firebug / Web Inspector commands without breaking IE
/**
* Create a fake console api, mimicing Firebug.
*/
(function(global) {
var noop = function(){};
if ( !global['console'] ) {
global.console = {
log : noop,
debug : noop,
@pete-otaqui
pete-otaqui / eg-console.js
Created September 30, 2011 14:25
EG-Console
(function () {
var div;
var divId = 'eg-console';
var noop = function () {};
var echo = function (fn, args) {
if (!div) {
div = document.createElement('div');
div.setAttribute('id', divId);
@pete-otaqui
pete-otaqui / appendAt.jquery.js
Created October 1, 2011 20:23
jQuery plugin to append content at a specific or random index
jQuery.fn.appendAt = function( content, index ) {
this.each(function(i, item) {
var $content = $(content).clone();
if ( index === 0 ) {
$(item).prepend($content);
} else {
$content.insertAfter($(item).children().eq(index-1));
}
});
@pete-otaqui
pete-otaqui / multiple_jquery_hell.html
Created October 6, 2011 10:48
Multiple jQueries have different Events
<!DOCTYPE html>
<html>
<head>
<title>Multiple jQuery Hell</title>
<script src="jquery-1.6.3.min.js"></script>
<script>
// keep a reference to jQuery 1.6.3, and clear the name from the global scope
jQuery163 = jQuery;
jQuery.noConflict(true);
</script>
@pete-otaqui
pete-otaqui / temp.html
Created October 18, 2011 15:05
Spanning
<!DOCTYPE html>
<html>
<head>
<style>
.richtext {
border:1px solid #000;
margin: 10px;
}
.richtext > span,
.richtext > p > span,
@pete-otaqui
pete-otaqui / find_in_branches
Created January 12, 2012 10:37
Find File Path Pattern in all git branches
#!/bin/bash
# Authored by Pete Otaqui <pete@otaqui.com>
#
# Core code taken from StackOverflow
# http://stackoverflow.com/questions/372506/how-can-i-search-git-branches-for-a-file-or-directory
#
# The author has placed this work in the
# Public Domain, thereby relinquishing all
# copyrights. Everyone is free to use, modify,
@pete-otaqui
pete-otaqui / jquery.fullscreen.js
Created February 7, 2012 10:47
HTML 5 FullScreen API jQuery Plugin
(function($) {
var body = document.body,
_standard = !!(body.requestFullScreen && document.cancelFullScreen),
_mz_style = !!(body.mozRequestFullScreen && document.mozCancelFullScreen),
_wk_style = !!(body.webkitRequestFullScreen && document.webkitCancelFullScreen),
_requestFullScreen, _cancelFullScreen, _fullScreenData;
@pete-otaqui
pete-otaqui / .screenrc
Created February 9, 2012 11:28
screenrc
screen -t current
chdir $HOME
screen
screen
select 0
altscreen on
#term screen-256color
# terminfo and termcap for nice 256 color terminal
@pete-otaqui
pete-otaqui / selenium_node_ie7.json
Created February 15, 2012 21:59
selenium_node_ie7.json
{
"capabilities":[
{
"browserName": "internet explorer",
"maxInstances": 10,
"version": "7",
"seleniumProtocol": "WebDriver",
"platform": "WINDOWS"
}
],