Skip to content

Instantly share code, notes, and snippets.

:octocat:
In coding land

Stephen Richardson sbrichardson

:octocat:
In coding land
View GitHub Profile
@sbrichardson
sbrichardson / plink-plonk.js
Created Feb 16, 2020 — forked from tomhicks/plink-plonk.js
Listen to your web pages
View plink-plonk.js
@sbrichardson
sbrichardson / what-forces-layout.md
Created Dec 9, 2019 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@sbrichardson
sbrichardson / what-forces-layout.md
Created Dec 9, 2019 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
View clone-all-twitter-github-repos.sh
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@sbrichardson
sbrichardson / opencv_blackfly.cpp
Created Jun 18, 2019 — forked from kevinhughes27/opencv_blackfly.cpp
A simple program showing how to capture from a Point Grey Research Camera and display the image using OpenCV
View opencv_blackfly.cpp
#include "FlyCapture2.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace FlyCapture2;
int main()
@sbrichardson
sbrichardson / opencv_blackfly.cpp
Created Jun 18, 2019 — forked from kevinhughes27/opencv_blackfly.cpp
A simple program showing how to capture from a Point Grey Research Camera and display the image using OpenCV
View opencv_blackfly.cpp
#include "FlyCapture2.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace FlyCapture2;
int main()
@sbrichardson
sbrichardson / tracking_info_from_email.js
Last active Jun 12, 2019
Misc notes when researching a solution for tracking Amazon Deliveries since there isn't a public API available.
View tracking_info_from_email.js
/**
* NOTE Breakdown of tracking url in shipping email from Amazon
* Delivery by Amazon, Tracking ID: TBA269148761000
*
*
* NOTE Process overview to obtain the tracking info and obtain
* updates for the delivery.
*
* Do Once
* ====================================
@sbrichardson
sbrichardson / Player.jsx
Created Apr 15, 2019 — forked from vincentriemer/Player.jsx
Player code for my Apple Music clone
View Player.jsx
// @flow
import * as React from "react";
import {
View,
StyleSheet,
Image,
Animated,
TouchableOpacity,
Text,
@sbrichardson
sbrichardson / polar.js
Last active May 2, 2020
Connects to a nearby bluetooth heart rate monitor and logs the active heart rate at 1hz (once per second). Tested with a Polar H10 HR monitor using Google Chrome.
View polar.js
/*
Make sure you are wearing the hr monitor, as it typically
goes to sleep when inactive, not allowing you to connect to it.
Instructions
===
1. Using Google Chrome, open the dev console and paste the below code.
2. A panel near the address bar will open, searching for nearby bluetooth (ble)
heart rate devices. Don't click away from the panel or Chrome will cancel the search.
3. When found, click connect on your device.
@sbrichardson
sbrichardson / sqlite-to-json.js
Created Jan 11, 2019
Browser based sqlite -> JSON/CSV. Exports sqlite database tables (using sql.js) to JSON, CSV, other (dev in progress).
View sqlite-to-json.js
/* NOTE Originally based on github.com/Philzen/WebSql-Loader */
const TABLE_SQL = "SELECT tbl_name from sqlite_master WHERE type = 'table'"
const MASTER_SQL = 'SELECT sql FROM sqlite_master'
const WEBKIT_INFO = '__WebKitDatabaseInfoTable__'
/* TODO Add other formats */
const FORMAT = {
JSON: 'json',
// CSV: 'csv',
You can’t perform that action at this time.