Skip to content

Instantly share code, notes, and snippets.

View joerodrig's full-sized avatar

Joe James Rodriguez joerodrig

View GitHub Profile
@joerodrig
joerodrig / starry-blocklist.txt
Last active June 19, 2020 23:10
Block requests made from the Starry router to their cloud servers
### StarryBlocker - Blocks requests made from the Starry router to their metrics/app/upgrade servers.
### Author Joseph Rodriguez - https://github.com/joerodrig
### License: MIT
### Updated: 2020-06-17
### NOTE: Blocking the URLs below will cause the Starry mobile application to no longer be able to 'connect' to the router
### and will prevent the router from auto-updates.
0.0.0.0 data.cloud.starry.com
0.0.0.0 upgrader.cloud.starry.com
0.0.0.0 stats-api-production-1282946093.us-east-1.elb.amazonaws.com
0.0.0.0 events.cloud.starry.com
@joerodrig
joerodrig / GIF-Screencast-OSX.md
Created August 20, 2019 17:55 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

##Deploying a Ruby on Rails application to Amazon Web Services

  1. Create a rails application
 $ rails new widgetly -T -d postgresql
  1. Inside the application folder, run the following:
@joerodrig
joerodrig / precincts_sectors_mapped_to_zip.json
Last active January 8, 2018 19:46
NYC Police Precincts and Sectors mapped to Zip codes
export default [
{"ZIP_CODE":"10001","PRECINCT":"10","SECTOR":"C"},
{"ZIP_CODE":"10002","PRECINCT":"7","SECTOR":"B"},
{"ZIP_CODE":"10003","PRECINCT":"9","SECTOR":"D"},
{"ZIP_CODE":"10004","PRECINCT":"1","SECTOR":"D"},
{"ZIP_CODE":"10005","PRECINCT":"1","SECTOR":"B"},
{"ZIP_CODE":"10006","PRECINCT":"1","SECTOR":"E"},
{"ZIP_CODE":"10007","PRECINCT":"1","SECTOR":"G"},
{"ZIP_CODE":"10009","PRECINCT":"9","SECTOR":"B"},
{"ZIP_CODE":"10010","PRECINCT":"13","SECTOR":"D"},

Building forms using React and Rails

SECTIONS:

  • Solutions
    ..- Solution 1: Full React Integration
  • Quick Comparison
  • Hybrid Approach Best Practices

Solution 1: Full React Integration

  1. Building the form:
    a. This solution is pretty straight-forward. You can either use ready made npm formbuilders for React or roll your own.
@joerodrig
joerodrig / ReactRailsWebpackRefetch.md
Last active March 16, 2016 03:33
React + Rails + Webpack and React-Refetch

Overview and Goals

React_On_Rails is an awesome library that integrates React + Rails + Webpack, with boilerplate to quickly get you up and running on a new project. React-Refetch is also another great library that makes reading and writing data to the server in React seamless. My goal here is to develop an architecture leveraging these two libraries that accomplishes three goals:

  1. Simple
  2. Easy to maintain
  3. Scalable

To accomplish this, our architecture will leverage React-Refetch and Rails routing to expose each component to the data needed on each given page, using our server data as the single source of truth, therefore minimizing or, idealy, completely removing our use of state to modify data on many pages. This reduces the fragile nature of offloading a batch of data to one large root component and dispersing it among nested sub-components. This also allows us to always have a 1-to-1 relationship betwee