Skip to content

Instantly share code, notes, and snippets.

View claudiopro's full-sized avatar
🐠

Claudio Procida claudiopro

🐠
View GitHub Profile
@mattheworiordan
mattheworiordan / jquery.focus.test-fix.js
Created August 23, 2011 22:47
Fix for :focus pseudo selector when browser does not have focus
/**
* JQuery tries to use native CSS selectors instead of the Sizzle selector
* engine for performance reasons.
*
* This causes problems when trying to test intefaces using the
* :focus pseudo selector as unless the web page and browser window
* has the focus, all elements are considered to be without focus.
* Checking for :focus in Selenium or Capybara tests therefore fail if
* using JQuery or Sizzle.
*
@Cosmeen
Cosmeen / hide-twitter-bloat.css
Last active May 14, 2016 05:09
hide-twitter-bloat.css for Stylish extension
/*
from @rem
https://twitter.com/rem/status/729628084115247104
*/
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
div[data-component-term="user-recommendations"],
div[data-component-term="trends"],
.promoted-tweet,

Justin Searls presents, "Tenderlove: the DHH story of a boy named Gary Bernhardt"

Short abstract

Ruby has heroes. Demigods who show us how to write better code. Turns out: they're just ordinary developers! This is the story of how I discovered that by becoming Ruby-famous. In the process, I learned our hero culture is toxic.

Want to keep Ruby weird? Stop listening to us (right after my talk).

Full abstract

@rbuckton
rbuckton / Promise.finally.md
Last active December 18, 2016 15:53
Proposal for addition of Promise.prototype.finally

NOTE I have yet to update this proposal, but I find @domenic's version here to be a much improved implementation:

Promise.prototype.finally = function (callback) {
    return this.then(
        value => this.constructor.resolve(callback()).then(() => value),
        reason => this.constructor.resolve(callback()).then(() => throw reason)
    );
};
Levs-MacBook-Pro-2:~ levlaz$ gem install rails -v 4.2.3
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: rack-test-0.6.3.gem (100%)
Successfully installed rack-test-0.6.3
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /Users/levlaz/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8/ext/nokogiri
@btm1
btm1 / set-repeat.js
Created September 28, 2013 20:17
Set repeat is an AngularJS directive to iterate over a group of elements only one time and not add any watch listeners. It works the same way as ng-repeat and uses angular templating engine to render it's results. i.e. set-repeat="message in messages" where messages is an array of objects. This iteration will not update if the length of the arra…
angular.module('setRepeat',[]).directive('setRepeat', function () {
return {
transclude: 'element',
priority: 1000,
compile: compileFun
};
function compileFun(element, attrs, linker) {
var expression = attrs.setRepeat.split(' in ');
@jchild3rs
jchild3rs / gist:470be49a4bc4caf3ca8a
Last active April 8, 2020 15:54
Hologram Gulp Plugin
/*
// Usage:
gulp.task('docs', function(cb) {
gulp.src('path/to/your/src')
.pipe(hologram(cb));
});
*/
var gulp = require('gulp'),
notify = require('gulp-notify'),
@mikaelbr
mikaelbr / gulpfile.js
Last active February 8, 2021 00:32 — forked from Sigmus/gulpfile.js
Gulp + Browserify + Reactify + OS Notification
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
@SunboX
SunboX / inlineworker.js
Created June 24, 2013 12:21
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@bzerangue
bzerangue / currency-symbols.xml
Last active February 28, 2022 11:52
World currencies with their symbols
<?xml version="1.0" encoding="UTF-8"?>
<!--
## SOURCE: xe.com
-->
<currency-symbol count="115">
<entry code="ALL" unicode-decimal="76, 101, 107" unicode-hex="4c, 65, 6b">Albania Lek</entry>
<entry code="AFN" unicode-decimal="1547" unicode-hex="60b">Afghanistan Afghani</entry>
<entry code="ARS" unicode-decimal="36" unicode-hex="24">Argentina Peso</entry>
<entry code="AWG" unicode-decimal="402" unicode-hex="192">Aruba Guilder</entry>
<entry code="AUD" unicode-decimal="36" unicode-hex="24">Australia Dollar</entry>