Skip to content

Instantly share code, notes, and snippets.

View telent's full-sized avatar

Daniel Barlow telent

View GitHub Profile
#define RELAY_PIN (8)
void setup() {
// put your setup code here, to run once:
SERIAL_PORT_USBVIRTUAL.begin(115200); // open serial connection via USB-Serial
pinMode(RELAY_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
@telent
telent / ralink-dtb.patch
Created July 25, 2018 00:14
ralink-dtb.patch
@telent
telent / default.nix
Created November 28, 2018 12:02
arcan build with nixos
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "arcan";
version="1";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake git
] ;
CMAKE_CXX_FLAGS = "-msse4.1";
DRM_INCLUDE_DIR = "${pkgs.libdrm.dev}/include/libdrm";
@telent
telent / iso.nix
Created November 29, 2019 21:57
nix livecd with "blocks" support for in-place bcache addition
{config, pkgs, lib, ...}:
let
maintboot = pkgs.python3Packages.buildPythonPackage rec {
pname = "maintboot";
version = "1";
src = pkgs.fetchFromGitHub {
owner = "g2p";
repo = "maintboot";
rev = "1c5ab872bae2b69a06252ca2e7ecdba4d4ad8e57";
sha256 = "0n8sy6ksqb5s1n5qqshb6pz1d86gjshwb30mr1nil0hfln5gi4g2";
#!/usr/bin/env nix-shell
#! nix-shell -i python -p python3
prefs = """
pref("toolkit.policies.perUserDir", true);
pref("ui.key.accelKey", 18);\n', # use Alt instead of Ctrl
"""
policies = {
"policies": {
{ config, pkgs, ... }:
let projectroot = "/home/git/"; # where are the repos on the disk?
subdir = "private-git"; # url path prefix
staticFilesPath = "cgit-static"; # url path to cgit's static assets
# /home/git/published-by-cgit contains the list of projects
# that cgit will show
cgitrc = pkgs.writeText "cgitrc"
''
# default paths to static assets
css=/${staticFilesPath}/cgit.css
{ pkgs }:
let env = builtins.getEnv "TELENT_NIXPKGS";
telentNixpkgsSrc =
if env != ""
then
(builtins.trace "TELENT_NIXPKGS is set, build is impure" env)
else
fetchTarball { name = "telent-nixpkgs"; url="https://verisons.telent.net/private-git/telent-nixpkgs.git/snapshot/telent-nixpkgs-master.tar.gz"; };
in {
isNormalUser = true;
#include <Adafruit_NeoPixel.h>
#include <math.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 2
#define STRIP_LENGTH 150
Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIP_LENGTH, PIN, NEO_GRB + NEO_KHZ800);
#include <Adafruit_NeoPixel.h>
#include <math.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "wifi-config.h"
"""
My first application
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
from rubicon.java import JavaClass