Skip to content

Instantly share code, notes, and snippets.

@ieb
ieb / testUsingTensorFlow.html
Last active April 17, 2023 14:57
Is in browser cosine similarity using a tensor flow model viable ?
<html>
<head>
</head>
<body>
<div>
This tests creating a sentence simularity index using tensorflow and then searching it.
It takes about 10s to generate the index using content from www.hlx.live containing 77 pages, and 5s to query that data with
1 sentence "Tell me about everything", indicating that a page in that site knows about everything.
@ieb
ieb / BME280.js
Last active January 22, 2022 09:22
Test Code for eBay BME280 order number 21-08080-91109 item 353751582230 from seller fiee-ki
var i2c = require('i2c-bus');
// Also works with BMP280 but returns 0 for humidity since that chip doesnt have humidity
// http://www.adafruit.com/datasheets/BST-BME280-DS001-11.pdf
var BME280 = function(options) {
options = options || {};
this.bus = (options.bus===undefined)?1:options.bus;
this.debug = options.debug || false;
@ieb
ieb / RedirectResolver.java
Last active January 31, 2020 12:14
RedirectResolver proposal
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@ieb
ieb / README.md
Created September 29, 2017 11:48
Configuring OAK-6575

This Gist contains information on how to Configure OAK-6575 to serve binary content direct from Oak via CloudFront, where the content is hosted in S3.

The provisioning model oak.txt in this Gist shows configuration.

Pre-requsites.

  • The deployment will be TarMK or MongoMK with a S3 DataStore.
  • Whoever is configuring needs root access to the AWS subscription to manage the keys in AWS.

Steps

@ieb
ieb / mongodb.conf
Created January 31, 2017 15:09
Modified Ganglia MongoDB WT configuration.
modules {
module {
name = "mongodb"
language = "python"
param server_status {
value = "mongo --quiet --eval 'printjson(db.serverStatus())'"
}
param rs_status {
value = "mongo --quiet --eval 'printjson(rs.status())'"
}
@ieb
ieb / mongodb.py
Created January 31, 2017 15:08
Modifed Ganglia Python module for MongoDB WT
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MongoDB gmond module for Ganglia
#
# Copyright (C) 2011 by Michael T. Conigliaro <mike [at] conigliaro [dot] org>.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@ieb
ieb / README.md
Created July 29, 2016 12:34
Sling Configuration spec

Sling Configuration Bundle.

This bundle provides a service API that may be used by components to interact with configuration. The bundle merges the work started in http://wcm.io/config and AEM Config Manager. For information on the API see sub projects contained within this source code tree. This file documents the semantic structure of configuration giving examples of how that configuration is persisted in the repository and in files.

Purpose

This document has been created to clarifiy and define precisely what is meant by various configuration related concepts. It is a live document, intended to be changed to support a shared understanding and eliminate confusion. It does not attept to define the Java APIs. For more detail on Java APIs or implementation look at the source code.

@ieb
ieb / ais.py
Last active October 7, 2023 15:37
Displaying AIS Data on Google Maps using the Google Maps API
#!/usr/bin/env python
#
# A Python AIVDM/AIVDO decoder
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
#
# This decoder works by defining a declarative pseudolanguage in which
# to describe the process of extracting packed bitfields from an AIS
# message, a set of tables which contain instructions in the pseudolanguage,
@ieb
ieb / gist:1374825
Created November 17, 2011 22:51
Dumb Simple Slow Luhn Test.
// A very simple Luhn check that only accepts sequence of digits as input.
// it scans the entire string with windows of 14,15,16 in width looking for a sequence that passes
// the luhn check. If it finds one it prints the original and the masked sequence, returning the
// masked sequence. If none are found, the original is returned.
// This is a dumb, slow, checker only intended to validate test sequences more quickly than doing
// manually. It outputs the progress to allow human validation.
public static String dumbSlowChecker(String test) {
char[] c = test.toCharArray();
@ieb
ieb / workflow.xsd
Created August 1, 2011 13:31
Example XSD for transformation
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd2hbm="http://www.tfd.co.uk/2006/xsd2hbm.xsd"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="Activities" xsd2hbm:action="set" xsd2hbm:targetclass="Activity" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="xpdl:Activity" minOccurs="0" maxOccurs="unbounded"/>