Skip to content

Instantly share code, notes, and snippets.

@malachib
malachib / PyQt5+EGLFS.md
Last active Jul 22, 2020
PyQt5 + Raspberry Pi + EGLFS notes
View PyQt5+EGLFS.md

Debian

Modules you probably need:

sudo apt-get install qt5-default qml-module-qtquick-controls qml-module-qtquick-controls2

Also recommended:

sudo apt-get install qml-module-qtlocation qml-module-qtpositioning

@malachib
malachib / ToDo.cshtml
Created Jun 4, 2018
Updated for Blazor 0.3.0
View ToDo.cshtml
@page "/todo"
@using Blazor1.Shared
@inject HttpClient Http
<h1>ToDo List</h1>
<div>
<div class="row">
<div class="col-sm-1">
<p>Item:</p>
@malachib
malachib / gist:5be56dfe2475759dd5bc087f80d26929
Created Oct 8, 2017
Convert modulus to a C friendly format
View gist:5be56dfe2475759dd5bc087f80d26929
#!/bin/bash
# Converts to a more C friendly format
echo -n '#define MODULUS "\x' > modulus.h
sed s/:/'\\'x/g <modulus.txt >> modulus.h
View netif.h
/**
* @file
* netif API (to be used from TCPIP thread)
*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
View gist:3ff06a8a629ad863246b6e01a5d1510d
struct netconn *conn = netconn_new_with_proto_and_callback(NETCONN_UDP, 0, NULL);
char buf[512];
if(!conn)
{
cerr << "Failed to allocate socket";
abort();
}
netconn_bind(conn, IP_ADDR_ANY, 5000);
@malachib
malachib / gist:151e3702d38d96e6683e2eded8f021d8
Created Dec 21, 2016
igmp_joingroup code... fails with a -6
View gist:151e3702d38d96e6683e2eded8f021d8
bool UDP_Multicast_init(void)
{
//bool IGMP_joined;
struct ip_addr ipgroup;
struct udp_pcb *g_udppcb;
char msg[] = "gaurav";
struct pbuf* p;
p = pbuf_alloc(PBUF_TRANSPORT,sizeof(msg),PBUF_RAM);
memcpy (p->payload, msg, sizeof(msg));
View gulpfile.js snippet
var paths = {
js: webroot + "js/**/*.js",
minJs: webroot + "js/**/*.min.js",
css: webroot + "css/**/*.css",
minCss: webroot + "css/**/*.min.css",
concatJsDest: webroot + "js/site.min.js",
concatCssDest: webroot + "css/site.min.css",
// added by Mal
npmSrc: "./node_modules/",
//paths.npmLibs = paths.webroot + "lib/npmlibs/"; // for some reason this didn't work further down in the code
View package.json
{
"name": "webapplication",
"version": "0.0.0",
"private": true,
"devDependencies": {
"gulp": "3.9.1",
"gulp-concat": "2.6.0",
"gulp-cssmin": "0.1.7",
"gulp-uglify": "1.5.3",
"rimraf": "2.5.2",