Skip to content

Instantly share code, notes, and snippets.

View jfeldstein's full-sized avatar

Jordan Feldstein jfeldstein

View GitHub Profile
@jfeldstein
jfeldstein / badge.html
Created April 6, 2016 17:38
Kiddom Trusted Voice HTML Badge 2016
<a href="https://www.kiddom.co/blog/trusted-voice" style="border:0" target="_blank">
<img src="https://s3.amazonaws.com/kiddom-marketing-assets/trusted-voice-badge.svg" alt="Trusted Voice, heard by Kiddom 2016" width="150"/>
</a>
@jfeldstein
jfeldstein / todo_app.js
Last active August 3, 2016 05:23
Notes on React:
class TodoApp extends Component {
mapStateToProps: (state) => ({
// Take a selection of the state, applying business logic to prepare it for consumption by a presentational component which is unaware of any business rules.
items: state.items.filter(i => i.visible)
})
mapDispatchToProps: (dispatch) => ({
// Callbacks which interact with the rest of the app
onClick: (id) => dispatch({type: "TOGGLE_TODO", id}),
})
@jfeldstein
jfeldstein / gist:8646648cd05935762fd707b4325b1e23
Last active December 20, 2016 19:43
My suggestion for settings state.
getState() => ({
// For
// - https://cl.ly/0G2G0N2U2f1V
// - and all of https://cl.ly/0b2O04192j2R
studentsInClassSettings: {
selectedClassId: "...",
// Get students to show using this classId, from
// getState().students.itemsById
currentSubScreenId: *_SCREEN_ID,
<script>
var DEBUG=!1,DEVICE_UNIQUE_ID="device_unique_id",DOMAIN=".kiddom.co",EVENT_LOADED_A_PAGE="Loaded a Page",PROTOCOL="https://",HOST="api.kiddom.co",PATH="/track/anonymous",TRACK_ENDPOINT=PROTOCOL+HOST+PATH,docCookies={getItem:function(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},setItem:function(e,t,o,s,n,a){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var i="";if(o)switch(o.constructor){case Number:i=o===1/0?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+o;break;case String:i="; expires="+o;break;case Date:i="; expires="+o.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+i+(n?"; domain="+n:"")+(s?"; path="+s:"")+(a?"; secure":""),!0},removeItem:function(e,t,o){return!!this.hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(o?"; domain="+o:"")+(t?"; path="
@jfeldstein
jfeldstein / Spec.md
Created March 31, 2022 22:11
Spec for Geography CRUD tool
  • Admin should be able to modify the geography's core attributes, thereby making it public
    • Flow: Admin has to fill in display_name and slug, then submit, then confirm latitude and longitude by submitting again.
      • Validation: slug and display_name must either both be filled, or neither. Admin cannot fill in only one or the other.
      • Admin should not see latitude, longitude, nor zoom if slug or display_name are empty.
      • Admin should see latitude, longitude, and zoom if slug and display_name are set.
        • When latitude and longitude are shown, system should show a small thumbnail map to confirm the map configuration is accurate
      • Existing behavior of the API:
        • If slug is NULL, the geograhy will not be exposed publicly
        • If slug is provided, the geography is accessible at /geography/:slug
  • New Behavior: