Skip to content

Instantly share code, notes, and snippets.

Thomas Steiner tomayac

Block or report user

Report or block tomayac

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
View dark_mode_solar.css
* {
box-sizing: border-box;
padding: 0;
margin: 0
}
html {
font-size: 20px
}
View lighthouse_json_dump.json
{
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
"lighthouseVersion": "2.5.0",
"generatedTime": "2017-11-01T11:30:50.138Z",
"initialUrl": "http://www.google.com/",
"url": "https://www.google.com/?gws_rd=ssl",
"audits": {
"is-on-https": {
"score": false,
"displayValue": "1 insecure request found",
@tomayac
tomayac / #intro.md
Last active Nov 17, 2017
Snippet repository
View #intro.md

There are many code snippets which can be quickly used to show/demo stuff in Chrome for demos or pitches, or just debugging, QA and testing. This is a collection of such snippets with some instructions Snippets can be saved to Chrome and run via one click again!

How to use snippets in Chrome

  • Open Command Menu in DevTools
  • Apple-Shift-P
  • Pick "Create new snippet"
@tomayac
tomayac / doodle.js
Last active Dec 12, 2016
Doodle Bookmarklet Wizard for Weekly Recurring Events
View doodle.js
javascript: (() => {
// Whenever you run the bookmarklet, always returns the next Wednesday.
const nextWednesday = () => {
let ret = new Date();
ret.setDate(ret.getDate() + (3 - 1 - ret.getDay() + 7) % 7 + 1);
return ret.toLocaleDateString('en-US', {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric'
@tomayac
tomayac / manifest-polyfill.html
Last active Jun 17, 2016 — forked from PaulKinlan/manifest-polyfill.html
Web App Manifest Polyfill for iOS
View manifest-polyfill.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="manifest" href="https://jsbin-user-assets.s3.amazonaws.com/kinlan/manifest.json">
<title>iOS Manifest Polyfill</title>
</head>
<body>
View web-bluetooth-test.js
// From https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
var services = [
'alert_notification',
'automation_io',
'battery_service',
'blood_pressure',
'body_composition',
'bond_management',
'continuous_glucose_monitoring',
'current_time',
View wikipedia.js
'use strict';
var async = require('async');
var request = require('request');
var ExpontentialSmoothingStream = require('exponential-smoothing-stream');
var numbers = require('numbers');
var geolib = require('geolib');
var util = require ('./util.js');
@tomayac
tomayac / lucky-winner.js
Created May 29, 2015
Highlights a lucky random attendant who RSVP'ed to a meetup organized via www.meetup.com
View lucky-winner.js
// Test at http://www.meetup.com/Google-Developer-Group-Hamburg/events/222392017/
document.querySelector('#rsvp-list').querySelectorAll('li')
[
Math.floor(
Math.random() *
document.querySelector('#rsvp-list').querySelectorAll('li').length
) + 1
].style.backgroundColor =
'rgb(' +
(Math.floor(Math.random() * 256)) + ',' +
View keybase.md

Keybase proof

I hereby claim:

  • I am tomayac on github.
  • I am tomayac (https://keybase.io/tomayac) on keybase.
  • I have a public key whose fingerprint is 6897 81EF 64CF F41E 7497 C1B4 5A9B C2AC 857C 0A63

To claim this, I am signing this object:

@tomayac
tomayac / avgWikipediaDeltas.js
Created Nov 25, 2014
Average Edit Length (Delta) for Wikipedias by Language
View avgWikipediaDeltas.js
// Full source
var source = new EventSource('http://wikipedia-edits.herokuapp.com/sse');
var languages = {};
var avgDeltas = {};
source.addEventListener('message', function(e) {
var edit = JSON.parse(e.data);
if (!languages[edit.language]) {
languages[edit.language] = [];
}
You can’t perform that action at this time.