Skip to content

Instantly share code, notes, and snippets.

View lafikl's full-sized avatar

Khalid Lafi lafikl

View GitHub Profile
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
if ( getParameterByName('field_ticket_number_value') ) {
$(".get-status").trigger('click');
$(document).ready( function() {
var acl = $('.active').offset();
var aw = $('.active').width();
var ll = acl.left + parseInt( aw / 2 );
var tt = acl.top + 39;
$('#active').css({
left : ll + 'px',
top : tt + 'px'
});
$('.link.ac a').on('click', function() {
<!DOCTYPE html>
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<!-- some HTML things here -->
<div class="scrollable"></div>
var s = new Steady({
conditions: {
"width": 400,
"min-top": 50,
"max-bottom": 200
},
throttle: 100,
handler: fn
});
// jQuery.event.swipe
// 0.5
// Stephen Band
// Dependencies
// jQuery.event.move 1.2
// One of swipeleft, swiperight, swipeup or swipedown is triggered on
// moveend, when the move has covered a threshold ratio of the dimension
// of the target node, or has gone really fast. Threshold and velocity
var el = document.getElementById('head'); // caching it for better performance
var steady = new Steady({
throttle: 100,
handler: function(el, done) {
console.log('woo!');
// this important to tell Steady that you finished processing so it can call you later
done();
}
});
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Wish list:

  • Round-robin load balancing
  • Failure detection
  • Results caching [LRU or/and Browser cache]
  • Webhooks, Notify subscribers when a certain event happens.
  • Plugins system, which will allow developers to add custom logic for their apps. Like sending results over statsd.
  • Websockets support for test progress
  • Dashboard to see what's happening in the cluster right now.
@lafikl
lafikl / .vimrc
Created January 15, 2015 12:31
my personal .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
@lafikl
lafikl / cssspecificity.css
Created November 22, 2012 15:58
CSS specificity example
ul li a {
color: red;
}
.item {
color: blue;
}
/* item will win! */