Skip to content

Instantly share code, notes, and snippets.

View jfeldstein's full-sized avatar

Jordan Feldstein jfeldstein

View GitHub Profile
@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:
<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 / 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,
@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 / 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 / circle.yml
Created January 2, 2016 01:38
Run Apache on CircleCI, and save logs as artifacts
machine:
hosts:
local.example.com: 127.0.0.1
dependencies:
pre:
- cp ./httpd.conf.circle /etc/apache2/sites-available/default
- sudo a2enmod rewrite
- sudo service apache2 restart
@jfeldstein
jfeldstein / legacy_campaign.rb
Created July 9, 2015 23:21
SET Campaign: Should Pull? Logic as of 7/9/15
# "LegacyCampaign" is what Super Sonic calls SET campaigns
class LegacyCampaign < ActiveRecord::Base
def self.should_pull(campaign)
vintage = self.is_good_vintage(campaign)
is_a_test = self.is_a_test(campaign)
# Special cases:
nhs_force = (campaign.company.master_branch.try(:name)=='NHS')
@jfeldstein
jfeldstein / categories.txt
Created June 9, 2015 05:16
Educational Categories on Academia.edu
http://www.academia.edu/Documents/in/Alternative_Education
https://www.academia.edu/Documents/in/Peer_observation_of_teaching
https://www.academia.edu/Documents/in/Teaching_Thinking_Skills
https://www.academia.edu/Documents/in/Student_Motivation_And_Engagement
https://www.academia.edu/Documents/in/Transformative_Learning
https://www.academia.edu/Documents/in/Educational_Research
http://www.academia.edu/Documents/in/Academic_Development
https://www.academia.edu/Documents/in/Peer_Support_Learning_and_Teaching_
http://www.academia.edu/Documents/in/Blended_Learning
http://www.academia.edu/Documents/in/Educational_Technology
@jfeldstein
jfeldstein / attribution_tracking_js.1.0.min.js
Last active August 29, 2015 14:20
Attribution Tracking Javascripts
(function(){var t,e,n,r,u,i,o,m,_,a,c,s;n=function(){return{first_referrer:e("first_referrer")||u()}},u=function(){var n,r,u,i,o;return o=document.referrer,n=t(o),r=null==n,i=n===t(document.location),u=null==o||i||r?e("latest_referrer"):n,{latest_referrer:u}},r=function(){var t,n,r,u;if(t={first_utm_name:e("first_utm_source"),first_utm_source:e("first_utm_source"),first_utm_medium:e("first_utm_medium"),first_utm_term:e("first_utm_term"),first_utm_content:e("first_utm_content")},null==t.first_utm_name){u=i();for(n in u)r=u[n],t[n.replace("latest_","first_")]=r}return t},i=function(){var t,n,r,u,i,o;return u=c(),r=u.utm_campaign,i=u.utm_source,n=u.utm_medium,o=u.utm_term,t=u.utm_content,null==r&&(r=e("latest_utm_name"),i=e("latest_utm_source"),n=e("latest_utm_medium"),o=e("latest_utm_term"),t=e("latest_utm_content")),{latest_utm_name:r,latest_utm_source:i,latest_utm_medium:n,latest_utm_term:o,latest_utm_content:t}},c=function(){var t,e;return t=document.location.search.substr(1),e={},t.split("&").forEach(functi
@jfeldstein
jfeldstein / CrawleraOFF
Created April 10, 2015 21:58
Crawlera Logs
Time (UTC) Level Message
0: 2015-04-08 21:35:55 INFO Log opened.
1: 2015-04-08 21:35:55 INFO Scrapy 0.25.0-298-g5846d61 started
2: 2015-04-08 21:35:55 INFO using set_wakeup_fd
3: 2015-04-08 21:35:55 INFO Scrapy 0.25.0-298-g5846d61 started (bot: amazon)
4: 2015-04-08 21:35:55 INFO Optional features available: ssl, http11, boto
5: 2015-04-08 21:35:55 INFO Overridden settings: {'NEWSPIDER_MODULE': 'amazon.spiders', 'LOG_LEVEL': 'INFO', 'CONCURRENT_REQUESTS_PER_DOMAIN': 32, 'CONCURRENT_REQUESTS': 32, 'SPIDER_MODULES': ['amazon.spiders'], 'STATS_CLASS': 'hworker.bot.stats.HubStorageStatsCollector', 'BOT_NAME': 'amazon', 'DOWNLOAD_TIMEOUT': 600, 'MEMUSAGE_LIMIT_MB': 512, 'MEMUSAGE_ENABLED': True, 'TELNETCONSOLE_HOST': '0.0.0.0', 'LOG_FILE': 'scrapy.log', 'DOWNLOAD_DELAY': 2.0, 'USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36'}
6: 2015-04-08 21:35:56 INFO HubStorage: writing items to http://storage.scrapinghub.com/items/12747/2/