Skip to content

Instantly share code, notes, and snippets.

Did you know your webapp had superpowers? by Szmozsánszky István (Flaki), Frontend Trainer @ DPC Consulting

Progressive Webapps' are just the nicer-sounding version of 'YES, the web can now do that too!' to inquiries about features that were previously reserved for native apps only.. but we are well past that point when offline-first or even native web-based push notifications were news. The unstoppable evolution of web technologies have moved onto greener pastures: storage improvements, improved JavaScript hardware access and new low-level APIs (like service workers themselves) make it possible to shout into your phone to control a game, transpile unsupported JavaScript features on demand and some other exciting/handy/futuristic usecases we are going to explore.

nolan pwa https://nolanlawson.github.io/pwas-2016-05-hackerlounge/ live streamed tomorrow

@flaki
flaki / FirefoxDevEdition48.js
Last active September 22, 2021 23:38
Go to firefox.com/developer. Paste the script into the console. Profit! 😎
/*
(!) Please make sure you've read the disclamer below! (!)
If you want to see how can you transform the Firefox Developer Edition landing
page into a fancy animation just
- navigate to http://firefox.com/developer *
- open the developer tools (F12)
- copy and paste this code into the console
- hit enter, and enjoy the show!
- you can follow the commentary via the console log
[{
"type": "HourlySalaryEmployee",
"salary": 10,
"name": "Anna",
"id": 1
},
{
"type": "HourlySalaryEmployee",
"salary": 8,
"name": "Bob",
@flaki
flaki / T2_OPENWRT.md
Created February 11, 2016 15:19
Helpful commands for the OpenWRT system used on the Tessel 2

OpenWRT for Dummies - Tessel 2 Edition

A kind-of-FAQ for operating the Tessel 2 from the commandline (via SSH, serial console or tessel root).

How to find out what commands are executed by the CLI?

Prefix your commands with "DEBUG=commands:usb" to learn about the commands sent to the device:

$ DEBUG=commands:usb t2 wifi -l

INFO Looking for your Tessel...
@flaki
flaki / angular.sh
Last active July 2, 2016 07:36
Angular project bootstrap via NPM
$ npm init
# Enter, enter...
$ npm install --save angular
$ npm install --save-dev angular-mocks
$ npm install -g karma-cli
$ npm install --save-dev karma mocha karma-mocha chai karma-chai
@flaki
flaki / spinnysaucer.ino
Created February 7, 2016 18:23
MARS ATTACK! A tiny hack on the Clouduboy Sprite Demo for the Arduboy
#include "Arduboy.h"
// Pre-drawn pixelart animation - Spinny Saucer (17x7, 2 frames)
PROGMEM const unsigned char sprite1[] = { /*17x7*/ 0x8, 0x18, 0x38, 0x38, 0x74, 0x7e, 0x6e, 0x3f, 0x2f, 0x3f, 0x6e, 0x7e, 0x74, 0x38, 0x38, 0x18, 0x8 };
PROGMEM const unsigned char sprite2[] = { /*17x7*/ 0x8, 0x18, 0x38, 0x38, 0x7c, 0x76, 0x7e, 0x2f, 0x3f, 0x2f, 0x7e, 0x76, 0x7c, 0x38, 0x38, 0x18, 0x8 };
Arduboy arduboy;
@flaki
flaki / manelbutterfly.ino
Created February 6, 2016 13:17
Happy Birthday Manel! A celebratory arduboy pocket game for the occasion.
#include <SPI.h>
#include "Arduboy.h"
#include <EEPROM.h>
#include <avr/pgmspace.h>
Arduboy arduboy;
// frame counter
@flaki
flaki / FirefoxEmoji.md
Last active January 8, 2016 21:12
Enabling FirefoxEmoji emoticons and the Firefox OS Emoji keyboard

Firefox OS Emoji 101

How to enable the built-in emoji keyboard?

  • Go to Settings ➡️ Keyboards ➡️ Select Keyboards:
  • Tick ✅ Emoji in the Built-in Keyboard group
  • Use the "change layout" button on the keyboard to switch between layouts, or
  • Long-press on the layout-change button and select "Emoji" to enable

If the option is not available, make sure you are on latest master, or if you are Foxfooding, set the nightly-latest update channel

@flaki
flaki / formerreps.js
Last active January 8, 2016 11:17
Check Rep status (active/former) in reps.mozilla.org dashboard
if (window.location.toString() === "https://reps.mozilla.org/dashboard/") {
[].forEach.call(
document.querySelectorAll('#dashboard-mentorship-block [href*="/u/"]'),
function(a) {
console.log("Checking "+a.href+" ... ");
var r = new XMLHttpRequest();
r.open("GET", a.href);
r.onreadystatechange = function () {
if (r.readyState != 4 || r.status != 200) return;
var former = r.responseText.match(/Former Rep/);
@flaki
flaki / halloweend.ino
Created November 1, 2015 01:33
Spooky version of the Arduboy rund.ino game (https://github.com/flaki/arduino-rund-ino)
#include <SPI.h>
#include "Arduboy.h"
#include <EEPROM.h>
#include <avr/pgmspace.h>
Arduboy arduboy;
// frame counter
unsigned int frame = 0;