Skip to content

Instantly share code, notes, and snippets.

@a-h
a-h / Dockerfile
Created November 2, 2018 11:06
Running AWS Scout in a Docker container
FROM python:3.7-alpine3.7
RUN pip install awsscout2
VOLUME ["/report"]
CMD /usr/local/bin/Scout2 --report-dir /report
#include <WiFiServerSecure.h>
#include <WiFiClientSecure.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiType.h>
#include <ESP8266WiFiAP.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WiFiScan.h>
@a-h
a-h / main.go
Created May 24, 2018 14:40
Webhook Receiver
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func main() {
h := handler{}
@a-h
a-h / buildspec.yml
Last active November 3, 2022 08:31
Build Go with private dependencies on AWS CodeBuild
version: 0.2
env:
parameter-store:
build_ssh_key: "build_ssh_key"
phases:
install:
commands:
- mkdir -p ~/.ssh
@a-h
a-h / main.go
Last active April 29, 2018 12:35
Find implementations of a function type
package main
import (
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
"log"
@a-h
a-h / main.go
Created April 23, 2018 20:32
XOR Training
package main
import (
"fmt"
"os"
"os/signal"
"time"
"github.com/a-h/ml/distance"
@a-h
a-h / main.go
Created April 2, 2018 14:29
KMeans on random 2D data
package main
import (
"fmt"
"math/rand"
"os"
"strconv"
"time"
"github.com/a-h/ml/clustering"
@a-h
a-h / 01-simple.test.js
Last active December 31, 2023 09:07
Testing styled Material UI components with Enzyme
import React from 'react';
import { shallow } from 'enzyme';
const Item = text => <p>Item {text}</p>;
const Composition = ({ showB }) => (
<p>
<Item text="A" />
{showB && <Item text="B" />}
</p>);
@a-h
a-h / usersettings.json
Last active October 21, 2018 20:02
Visual Studio Code Settings
{
"go.coverOnSave": true,
"go.testOnSave": true,
"go.autocompleteUnimportedPackages": true,
"window.zoomLevel": 1,
"git.confirmSync": false,
"editor.renderWhitespace": "all",
"editor.minimap.enabled": false,
"workbench.colorCustomizations": {
"terminal.foreground": "#ffffff",
@a-h
a-h / out_of_memory.txt
Created March 14, 2018 08:44
Lambda Failure Log Entries
START RequestId: 16f8d3a2-26fc-11e8-bca6-73dbc61c39e7 Version: $LATEST
I'm about to use up a lot of RAM...
1MB consumed
2MB consumed
3MB consumed
4MB consumed
5MB consumed
6MB consumed
7MB consumed
8MB consumed