Skip to content

Instantly share code, notes, and snippets.

View staaky's full-sized avatar

Nick Stakenburg staaky

View GitHub Profile
@staaky
staaky / twitter-remove-promoted-tweets.user.js
Last active September 29, 2024 02:44
Twitter - Remove Promoted Tweets
// ==UserScript==
// @name Twitter - Remove Promoted Tweets
// @description Remove promoted tweets from Twitter
// @author Nick Stakenburg
// @namespace https://gist.githubusercontent.com/staaky
// @license MIT; https://opensource.org/licenses/MIT
// @updateURL https://gist.githubusercontent.com/staaky/743103cc6e0e6a4bff6d2fca73e95d1e/raw/twitter-remove-promoted-tweets.user.js
// @downloadURL https://gist.githubusercontent.com/staaky/743103cc6e0e6a4bff6d2fca73e95d1e/raw/twitter-remove-promoted-tweets.user.js
// @include http://twitter.com/*
// @include https://twitter.com/*
/*!
* Disable Fresco on Mobile Browsers
* http://www.frescojs.com
*/
(function($) {
var SUPPORTS_TOUCH = (function() {
try {
return !!(('ontouchstart' in window) ||
window.DocumentTouch && document instanceof DocumentTouch);
} catch (e) {
/* A quick parent/child helper idea for tipped.js
* blocks parent tooltips from hiding when child tooltips are open
* http://groups.google.com/group/tippedjs/browse_thread/thread/29a65b3a4c0a37df
*/
(function($) {
window.TippedParentChildHelper = {
showChild: function(content, element) {
var parent = element.getAttribute('data-tipped-parent');
getHiddenDimensions: function(element) {
element = $(element);
var check = element.ancestors(),
restore = [],
styles = [];
check.push(element);
// All *Width and *Height properties give 0 on elements with display none,
// or when ancestors have display none, so enable those temporarily
check.each(function(c) {
var Feature = (function() {
var tests = {
DOCUMENT_GETELEMENTBYID_CONFUSES_IDS_WITH_NAMES: function() {
// need to feature test all these DOM methods before calling them
var num = Number(new Date()),
name = '__test_' + num,
head = document.getElementsByTagName('head')[0],
isBuggy = false,
el;
@staaky
staaky / gist:17204
Created October 16, 2008 17:00
Cross browser way to set a PNG background image on an element using Prototype.
Element.addMethods({
setPngBackground: (function() {
var IEBelow7 = (function(agent) {
var version = new RegExp('MSIE ([\\d.]+)').exec(agent);
return version ? parseFloat(version[1]) < 7 : false;
})(navigator.userAgent);
return function(element, url) {
element = $(element);
var options = Object.extend({