Skip to content

Instantly share code, notes, and snippets.

View karlcow's full-sized avatar
⛩️
Working from … anywhere

Karl Dubost karlcow

⛩️
Working from … anywhere
View GitHub Profile
C = function() {
var a,
b,
c,
d,
e,
f,
h,
i,
j,
@karlcow
karlcow / missyou.js
Created February 10, 2016 00:13
useless script detected on https://fabriceleven.com/design/moo-luxe-review-business-cards/ which changes the title of the tab when moving to another tab.
// found on https://fabriceleven.com/design/moo-luxe-review-business-cards/
//add some cool text to the title
(function() {
var hidden = "hidden";
var oldtitle = document.title;
var currenttitle;
// Standards:
if (hidden in document)
@karlcow
karlcow / results.txt
Created August 7, 2015 01:14
extracting URL and timestamp from HAR
→ egrep '"startedDateTime":|"url":' Archive\ 15-08-07\ 10-08-25.har
"startedDateTime": "2015-08-07T10:06:50.793+09:00",
"startedDateTime": "2015-08-07T10:06:50.793+09:00",
"url": "https://webcompat.com/",
"startedDateTime": "2015-08-07T10:06:53.194+09:00",
"url": "https://webcompat.com/js/webcompat.min.js?d4711fe1bd91f319dcd133d9047f2bd2",
"startedDateTime": "2015-08-07T10:06:53.195+09:00",
"url": "https://webcompat.com/js/diagnose.min.js?afa0e3e97584e8ee1122227efb93ed7a",
"startedDateTime": "2015-08-07T10:06:53.211+09:00",
"url": "https://avatars.githubusercontent.com/u/505230?v=3s=40",
0.8002 - 247sports.com
1.0000 - about.com
0.8970 - allenbwest.com
0.8252 - americanoverlook.com
0.9455 - anchorfree.us
1.0000 - bestbuy.com
0.9500 - cbssports.com
0.7540 - cnn.com
0.8482 - conservativetribune.com
0.7430 - craigslist.org
@karlcow
karlcow / mozilla-central.sublime-project
Last active August 29, 2015 14:23
sublime-text-config for mozilla-central
{
"folders": [{
"path": "/Users/karl/code/mozilla-central"
}],
"settings": {
"trim_trailing_white_space_on_save": false
},
}
<html class="ui-mobile" itemscope="" itemtype="http://schema.org/Article" lang="ja">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<link rel="stylesheet" href="/css/new-design.css?date=20150414" media="all">
</head>
<body>
<div class="contents">
<table class="contents-table triple-table first-feature-table">
<tbody>
var number = 10000.20;
console.log('default (' + window.navigator.language + '): ' + number.toLocaleString());
console.log('fr-FR: ' + number.toLocaleString('fr-FR'));
console.log('fr: ' + number.toLocaleString('fr'));
console.log('en-US: ' + number.toLocaleString('en-US'));
console.log('en: ' + number.toLocaleString('en'));
console.log('ja: ' + number.toLocaleString('ja'));
console.log('zh: ' + number.toLocaleString('zh'));
@karlcow
karlcow / xmlhttprequest.js
Last active August 29, 2015 14:17
This will fail with Gecko not being followed by a year, but a version number like in… Firefox OS and Firefox Android. Found in http://static0.viadeo-static.com/resource/308570/tetra-viadeo-VNS.js
setRequestHeaders: function() {
var a = {
'X-Requested-With': 'XMLHttpRequest',
'X-Prototype-Version': Prototype.Version,
Accept: 'text/javascript, text/html, application/xml, text/xml, */*'
};
if ('post' ==
this.method && ('undefined' === typeof a['Content-Type'] && (a['Content-Type'] =
this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : '')
),

Firefox Android.

Everything is working well.

→ http --print hH http://www.vente-privee.com/ 'User-Agent:Mozilla/5.0 (Android; Mobile; rv:36.0) Gecko/36.0 Firefox/36.0'

The request:

@karlcow
karlcow / cdp.bash
Created March 18, 2015 22:33
cdp os.path… will put you in the directory of the module.
# To put in your .bashrd use with example
# cdp os
# to reach the directory where the os python module is.
cdp () {
cd "$(python -c "import os.path as _, ${1}; \
print(_.dirname(_.realpath(${1}.__file__[:-1])))"
)"
}