Skip to content

Instantly share code, notes, and snippets.

{
"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",
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
@malachib
malachib / gist:151e3702d38d96e6683e2eded8f021d8
Created December 21, 2016 12:07
igmp_joingroup code... fails with a -6
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));
@malachib
malachib / gist:3ff06a8a629ad863246b6e01a5d1510d
Created December 31, 2016 20:06
Unexpected corruption
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);
/**
* @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,
@malachib
malachib / gist:5be56dfe2475759dd5bc087f80d26929
Created October 8, 2017 18:36
Convert modulus to a C friendly format
#!/bin/bash
# Converts to a more C friendly format
echo -n '#define MODULUS "\x' > modulus.h
sed s/:/'\\'x/g <modulus.txt >> modulus.h
@malachib
malachib / ToDo.cshtml
Created June 4, 2018 23:43
Updated for Blazor 0.3.0
@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 / PyQt5+EGLFS.md
Last active May 17, 2022 01:06
PyQt5 + Raspberry Pi + EGLFS notes

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

import QtQuick
import QtQuick.Layouts
//import PGQT_43 // EXPERIMENTAL, made no difference except to inform that DataObject can be explicitly stated
ListView {
required model
delegate: Rectangle {
id: testDel
#include <iostream>
#include <string>
// think of 'nibbles' parameter as a kind of hexidecimal version of decimal places
std::string int_to_hex(unsigned long value, int nibbles)
{
static const char converter[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
// stack allocate C style string, just enough to fit 'nibbles' amount