Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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...
[{
"type": "HourlySalaryEmployee",
"salary": 10,
"name": "Anna",
"id": 1
},
{
"type": "HourlySalaryEmployee",
"salary": 8,
"name": "Bob",
@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

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 / quickstart.md
Created January 20, 2017 15:15
How to node on the PocketCHIP

How to node on the PocketCHIP?

Install node.js

Install node from NodeSource PPA

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
@flaki
flaki / README.md
Last active March 23, 2017 16:03
Animate the Mozilla.org CSS Grid demo!

How To Use?

  1. Navigate to Mozilla.org's CSS Grid demo page
  2. In Firefox, open devtools and create a new stylesheet. Copy grid-logo-animate.css's contents in there!
    • Alternatively you can copy/paste grid-logo-animate.js into the devtools console and hit enter—this should work in any browser.
  3. Hover the logo, watch it fade away.
  4. Lean back, move your cursor off the logo, and enjoy!
@flaki
flaki / undefined.js
Created April 5, 2017 06:20
Shadowing undefined
(function() {
// Won't work, 'undefined' is a property on the global object, but it's unconfigurable (not modifiable)
try {
Object.defineProperty(window, 'undefined', { value: 42 });
} catch (e) { console.log(e.toString()) }
// But 'undefined' could be still shadowed, because it's not a keyword - its name is usable as an identifier
var undefined = 42;
// foo is a non-existent property on the window object