Skip to content

Instantly share code, notes, and snippets.

View raulb's full-sized avatar
👨‍💻
Ask me anything!

Raúl Barroso raulb

👨‍💻
Ask me anything!
View GitHub Profile
@raulb
raulb / gist:1867822
Created February 20, 2012 04:17
Fadeout test with Jasmine
// If we want to test Asynchronous events we should use waits or waitsFor
// To test a fadeOut effect, waits(num ms) could be ok, but is not too smart in my opinion
// more info: https://github.com/pivotal/jasmine/wiki/Asynchronous-specs
// What happens if we want to test if any element is correctly deleted but before of that the element is going into a fadeOut
// event?. Which is happening is its opacity is going to 0 but immediately of that the element is undefined.
// This is my way to do it:
it("If one element is deleted correctly", function() {
@raulb
raulb / Dragabble table bookmarklet
Created August 1, 2011 11:26
Ability dragabble options to each cases in a table
window.bookmarklet = function(opts){fullFunc(opts)};
// These are the styles, scripts and callbacks we include in our bookmarklet:
window.bookmarklet({
js : ['http://dl.dropbox.com/u/3655882/jquery.tablednd_0_5.js'],
jqpath : 'http://jquery.com/src/jquery-latest.js',
ready : function(){
@raulb
raulb / gist:1091554
Created July 19, 2011 07:14 — forked from javierarce/gist:1090744
Color Picker bookmarklet for Dribbble.com
javascript: void((function() {
var colors = [];
var title = document.title.replace(/Dribbble - /g, '');
var li = document.getElementsByClassName('color');
if (li.length > 0) {
for (var i = 0; i < li.length; i++) {
var c = li[i].getElementsByTagName('a')[0].getAttribute('title');
colors.push('<li><div style="display:inline-block; width:20px; height:20px;background:' + c + '"></div> ' + c + '</li>');
}