Skip to content

Instantly share code, notes, and snippets.

View hpainter's full-sized avatar

Homer Painter hpainter

View GitHub Profile
@hpainter
hpainter / admin-users.txt
Created July 13, 2017 20:36
CareOS Data Transition
*************************** 1. row ***************************
user_id: 3302
email: [email protected]
person_id: 3302
name: Andrew Mayers
*************************** 2. row ***************************
user_id: 9278
email: [email protected]
person_id: 9018
name: Looooouie Cheung
@hpainter
hpainter / query.js
Created May 18, 2017 19:32
es query demo
query.bool.filter.push({
"bool": {
// top-level status term group...doc must match one of these 'shoulds'
"should": [
// Available status
{
"bool": {
"must": [
{"term": { "status": "Available"}},
{"bool": { "should": [
// in our last episode...
const colleague_ids = [100,101,102,4,8888333777];
// meanwhile, back at appointments.js line 179:
if(params.isOrgRelated){
query.bool.must.push({
bool: {
should: [
{term: { "subject_id": colleague_ids }},
function (sInput){
var sOutput='';
for(var i=0,c=sInput.length;i<c;i++){
var nChar=sInput.charCodeAt(i);
if(nChar>=33&&nChar<=126){
sTmp=String.fromCharCode(33+(((nChar-33)+47)%94));
sOutput+=sTmp
}else{
sOutput+=sInput.charAt(i)
}
@hpainter
hpainter / expander.js
Last active September 24, 2015 19:02
expanding sections
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<style type="text/css">
/* add your css here */
</style>
</head>
@hpainter
hpainter / SM Company Users
Last active August 29, 2015 14:26
SM Company Users
## SM Company Users
### Requirements Summary
- All ScoopMonkey users must be affiliated with a valid FMCSA record through a ScoopMonkey Company record.
- An FMCSA record may have one and only one corresponding ScoopMonkey company record. The SmCompany record allows for user customization of FMCSA data (company name, address, etc) while still letting us maintain a clean copy of the FMCSA data.
- An SmCompany record will have one and only one user designated as it's 'Manager'. The managing user is responsible for billing and all company-related changes.
- Multiple users may belong to the same company, within quota limits defined by the managing user's subscription package.
- Users who wish to join a company that already exists in the ScoopMonkey system must request to be added by the company manager.
- Non-managing users do not get billed for a subscription, but they do inherit subscription permissions from the manager account.
- Users who are unaffiliated with a company (either because they were removed b
/*
HC-SR04 Ping distance sensor]
VCC to arduino 5v GND to arduino GND
Echo to Arduino pin 13 Trig to Arduino pin 12
Red POS to Arduino pin 11
Green POS to Arduino pin 10
560 ohm resistor to both LED NEG and GRD power rail
More info at: http://goo.gl/kJ8Gl
Original code improvements to the Ping sketch sourced from Trollmaker.com
Some code and wiring inspired by http://en.wikiversity.org/wiki/User:Dstaub/robotcar
// Class to load a remote RSS feed and create DOM elements with a
// CSS parallax effect applied. Requires jQuery, Google jsapi
// Constructor. Accepts attributes hash, eg:
// {
// url: "http://foo.com", // Feed url
// qty: 40, // Items to fetch
// target: "#foo_feed", // Parent element selector
// template: "#bar" // Item template selector
// }
#item_template {
display: none;
}
#feed .item {
width: 300px;
height: 125px;
box-shadow: -5px 5px 8px #888;
background: #FFF;
border-color: #000
}
!--// Feed item container //-->
<div class="parallax" id="feed">&nbsp;</div>
<!--// Feed item template //-->
<div id="item_template" class="layer">
<a href="#" class="item-href" target="_new">
<div class="item panel radius clearfix">
<span class="item-image">
<i class="fi-photo">&nbsp;</i>