Skip to content

Instantly share code, notes, and snippets.

@jahudka
jahudka / btp.ino
Created October 25, 2023 17:47
WVR backing track player
#include <WVR.h>
#include <wvr_pins.h>
#include <button.h>
WVR wvr;
Button* btnWifi;
Button* btnPlay;
Button* btnPrev;
Button* btnNext;
@jahudka
jahudka / gulpfile.js
Created April 15, 2019 10:04
Nittro with WebPack
const gulp = require('gulp');
const ternary = require('ternary-stream');
const nittro = require('gulp-nittro');
const webpack = require('webpack-stream');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const sourcemaps = require('gulp-sourcemaps');
const builder = new nittro.Builder({
base: { /* ... */ },
@jahudka
jahudka / Datagrid.js
Last active November 2, 2018 16:12
Nittro integration with Nextras Datagrid: prevent Datagrid requests from being saved in browser history
_context.invoke('Nextras', function(DOM) {
var Datagrid = _context.extend(function(snippetManager, page) {
this._ = {
snippetManager: snippetManager,
page: page,
hasGrid: false
};
this._.snippetManager.on('after-update', this._handleUpdate.bind(this));
@jahudka
jahudka / template.latte
Created August 4, 2016 17:05
Sample of the Nittro DropZone plugin usage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Dropzone example</title>
<script type="application/json" id="nittro-params">
{
"basePath": "/"
}
@jahudka
jahudka / MyService.js
Created July 4, 2016 09:07
Nittro AJAX events demo
// For a global handler you can create a custom service.
// You'd include this file in your minified site script after Nittro but before bootstrap:
_context.invoke('App', function() {
var MyService = _context.extend(function(page, ajax) {
this._ = {
page: page,
ajax: ajax
};
this._.page.on('create-request', this._handleCreateRequest.bind(this));
@jahudka
jahudka / presenter.php
Last active June 23, 2016 09:50
Sample of Nittro usage in a basic datagrid-like setting
<?php
use Nittro\Bridges\NittroUI\Presenter,
Nette\Application\UI\Form;
class PeoplePresenter extends Presenter {
/** @var \Dibi\Connection */
private $dibi;