Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Karl Dubost karlcow

🏠
Working from home
Block or report user

Report or block karlcow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@karlcow
karlcow / larger_than.js
Created Sep 2, 2019
Iterate through the DOM to search element wider than a certain width.
View larger_than.js
// Iterate through the DOM to search element wider than a certain width.
// Practical for issues with invisible blocks creating layout issues
// on mobile.
// set here the maxwidth of your choice.
var maxwidth = 414;
var startElem = document.getElementsByTagName('body')[0];
var items = startElem.getElementsByTagName("*");
for (var i = items.length; i--;) {
if (items[i].getBoundingClientRect()['width'] > maxwidth) {
console.log(items[i], items[i].getBoundingClientRect()['width'])
View sitewait-open-2019-08-27.txt
329 severity-critical 2019-07-16T17:55:32Z
803 severity-important 2019-06-20T14:25:42Z
861 null 2019-08-22T12:52:53Z
1061 severity-important 2019-08-22T14:16:19Z
1551 severity-critical 2019-08-23T11:50:25Z
1804 severity-important 2019-08-22T11:43:37Z
2005 severity-critical 2019-08-23T12:22:30Z
2009 severity-important 2019-08-22T13:56:12Z
2070 severity-critical 2019-08-22T13:05:51Z
2498 severity-important 2019-08-24T23:25:50Z
View testcase-reducer.css
* {
padding: 0;
margin: 0;
}
html,
body {
height: 100%;
overflow: hidden;
width: 100%;
}
@karlcow
karlcow / fastclick.md
Last active May 20, 2019
Documenting fastclick finding on webcompat.com
View fastclick.md
View selector-mad.css
.Intro-content .sqs-col-12>.sqs-block:not(.float):not(.sqs-float-left):not(.sqs-float-right):not(.sqs-block-gallery):not(.sqs-block-image):not(.sqs-block-video):not(.sqs-block-map):not(.sqs-block-calendar):not(.sqs-block-menu):not(.sqs-block-tourdates):not(.sqs-block-summary-v2):not(.sqs-block-archive):not(.sqs-block-instagram),
.Main:not(.Main--events-list):not(.Main--events-item):not(.Main--blog-list) .Main-content .sqs-layout .sqs-col-12>.sqs-block:not(.float):not(.sqs-float-left):not(.sqs-float-right):not(.sqs-block-gallery):not(.sqs-block-image):not(.sqs-block-video):not(.sqs-block-map):not(.sqs-block-calendar):not(.sqs-block-menu):not(.sqs-block-tourdates):not(.sqs-block-summary-v2):not(.sqs-block-archive):not(.sqs-block-instagram),
.tweak-blog-list-style-stacked .BlogList--posts-full .sqs-layout .sqs-col-12>.sqs-block:not(.float):not(.sqs-float-left):not(.sqs-float-right):not(.sqs-block-gallery):not(.sqs-block-image):not(.sqs-block-video):not(.sqs-block-map):not(.sqs-block-calendar):not(.sqs-block-menu
View gif.worker.js
(function(b) {
function a(b, d) {
if ({}.hasOwnProperty.call(a.cache, b)) return a.cache[b];
var e = a.resolve(b);
if (!e) throw new Error('Failed to resolve module ' + b);
var c = {
id: b,
require: a,
filename: b,
exports: {},
View resize-filter.py
from PIL import Image
import time
FILTER_LIST = [('nearest', Image.NEAREST),
('bilinear', Image.BILINEAR),
('bicubic', Image.BICUBIC),
('lanczos', Image.LANCZOS),
('antialias', Image.ANTIALIAS)]
FILE = '/Users/karl/Documents/2016/10/12/thumbnail-test/original.png'
SIZE = (500, 500)
@karlcow
karlcow / fimstrip.py
Created Jun 20, 2018 — forked from nvbn/fimstrip.py
fimstrip.py
View fimstrip.py
from collections import Counter
import requests
from pycaption.srt import SRTReader
import lxml.html
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
lang = 'en-US'
path = ''
@karlcow
karlcow / modal.css
Last active May 30, 2018
joi's cite button
View modal.css
this is it.
The HTML is pre-generated.
The cite button just change the display to not hidden so the div appears.
View needsdiagnosis-monitor.py
#!/usr/bin/env python3
# encoding: utf-8
"""
Monitor the needsdiagnosis milestones.
Created by Karl Dubost - 2018-02-18
"""
import datetime
import json
You can’t perform that action at this time.