Skip to content

Instantly share code, notes, and snippets.

View llama-vision-snippet.js
// Load the prediction model
mobilenet.load().then(model => {
// Now we can keep checking the camera feed at regular intervals, like this:
model.classify(video).then(predictions => {
const topResult = predictions[0];
if (topResult.className === 'llama') {
// Woo! Llama! NB. We can also get the confidence value from the `probability`
@poshaughnessy
poshaughnessy / 01-load-page.py
Created Sep 12, 2018
Samsung Internet WebDriver ChromeDriver example
View 01-load-page.py
# Basic example of running Samsung Internet v8.x using ChromeDriver v2.36
import time
from selenium import webdriver
options = webdriver.ChromeOptions()
# NB. when v8 stable is released you can use with 'com.sec.android.app.sbrowser'
options.add_experimental_option('androidPackage', 'com.sec.android.app.sbrowser.beta')
options.add_experimental_option('androidActivity', 'com.sec.android.app.sbrowser.SBrowserMainActivity')
options.add_experimental_option('androidDeviceSocket', 'Terrace_devtools_remote')
@poshaughnessy
poshaughnessy / samsung-internet-versions-rough-guide.md
Last active Oct 5, 2020
Rough browser version guide for Samsung Internet
View samsung-internet-versions-rough-guide.md

v1.x (v1.0: Chromium 18, v1.5 & v1.6: Chromium 28)

v1 logo

Originally based on the stock Android browser (AOSP), 2012.

"It was around early 2013 when we made [the decision to move to Chromium]. We shipped our first Chromium-based browser in one of the Galaxy S4 models released later in 2013." (Source)

  • v1.0 preloaded in Galaxy S4
  • v1.5 preloaded in Galaxy Note 3
View Event queue sketch
function sync(queue) {
// do some async operation
}
function syncFail(failedEvents, queue) {
failedEvents.forEach(e => queue.enqueue(e));
queue.set([...failedEvents, queue]);
}
View jsonmodelviewer.html
<!doctype html>
<html lang="en">
<head>
<title>Three.js JSON model viewer</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Monospace;
background-color: #ccc;
@poshaughnessy
poshaughnessy / app.js
Created Jan 31, 2012
Simple static site on Heroku with Node.js
View app.js
var express = require('express');
var port = process.env.PORT || 3000;
var app = express.createServer();
app.get('/', function(request, response) {
response.sendfile(__dirname + '/index.html');
}).configure(function() {
app.use('/images', express.static(__dirname + '/images'));
}).listen(port);