Skip to content

Instantly share code, notes, and snippets.

View d-a-v's full-sized avatar

david gauchard d-a-v

  • Toulouse, France
View GitHub Profile
@mobizt
mobizt / Large_File_Web_Server_Test.ino
Last active May 15, 2021 01:40
This example sketch shows how to use webserver to send large data to client (500 kB jpeg image)
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include "image.h"
const char *ssid = "your wifi ssid";
const char *password = "your wifi password";
#include "Arduino.h"
#include "timeout.h"
void runtest1()
{
using namespace esp8266;
polledTimeoutOneShot timeout(3000);
Serial.print("before while 1\n");
while(!timeout.expired())
@sparrc
sparrc / install-ffmpeg.sh
Last active November 14, 2023 13:24
Installs ffmpeg with libaom and libx265 enabled for av1 and hevc encoding (tested on Ubuntu 16.04)
#!/usr/bin/env bash
# Installs ffmpeg from source (HEAD) with libaom and libx265, as well as a few
# other common libraries
# binary will be at ~/bin/ffmpeg
sudo apt update && sudo apt upgrade -y
mkdir -p ~/ffmpeg_sources ~/bin
export PATH="$HOME/bin:$PATH"
@a4099181
a4099181 / dice.scad
Last active October 27, 2019 20:40
OpenSCAD: dice.
/*
* 6-sided play cube
*/
$fn = 128 ;
WIDTH = 64 ;
DOT_DEEP = 3 ;
DOT_DENSITY = .2 ;
DOT_TABLE = [
[ 2, [ 2, 3, 4, 5, 6 ] ]
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@revolunet
revolunet / bluetooth.js
Created May 28, 2013 19:38
Chrome Packaged app Bluetooth API example
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(
@netj
netj / readonlyroot.sh
Created September 14, 2011 12:00
init.d script for Debian read-only root filesystem
#! /bin/bash
# readonlyroot.sh -- Setup dirs on the tmpfs to keep the root partition read-only
# See-Also: http://roland.entierement.nu/pages/debian-on-soekris-howto.html
# Available-At: https://gist.github.com/1216392
#
# Place this file in /etc/init.d and run:
# sudo update-rc.d readonlyroot.sh start 04 S
#
# To maintain persistent data, place a file at /etc/cron.d/readonlyroot as:
# 0 * * * * root /etc/init.d/readonlyroot.sh save >/dev/null