Skip to content

Instantly share code, notes, and snippets.

@ryanj
Last active December 22, 2015 03:18

Revisions

  1. ryanj revised this gist Sep 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ Last month, when I had originally looked into making this application available

    While on OpenShift, your application's port and IP address will be provided automatically (read-only).

    Now you can define custom environment variables while creating a new app:
    Now you can define your own custom environment variables while creating an app:

    rhc app create citibikes ruby-1.9 --env CITIBIKE_NEARBY_STATIONS="268,257,2010" --from-code=https://github.com/edgar/citibikenyc_dashboard.git

  2. ryanj revised this gist Sep 6, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,9 @@ Last month, when I had originally looked into making this application available
    set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
    set :bind, ENV['OPENSHIFT_RUBY_IP'] if ENV['OPENSHIFT_RUBY_IP']

    Developers can now define custom environment variables as a part of their application creation process:
    While on OpenShift, your application's port and IP address will be provided automatically (read-only).

    Now you can define custom environment variables while creating a new app:

    rhc app create citibikes ruby-1.9 --env CITIBIKE_NEARBY_STATIONS="268,257,2010" --from-code=https://github.com/edgar/citibikenyc_dashboard.git

  3. ryanj revised this gist Sep 6, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -33,15 +33,15 @@ I did some quick work to modify an existing [Citibike Dashboard](https://github.
    ## CitibikeNYC Dashboard
    Edgar's citibike dashboard uses his own [Citibike ruby client library](https://github.com/edgar/citibikenyc) to fetch data on the status of selected local bike hubs nearby. ***Very impressive!***

    Last month, when I had originally looked into making this application available on OpenShift, we were missing support for setting custom environment variables from outside a hosted application. In the last week, we've added that feature along with quite a few more.

    ###### Putting OpenShift's New Custom Environment Variables To Work

    [The following two lines](https://github.com/edgar/citibikenyc_dashboard/commit/72071d99474743903366e0deecb6421675054b12#L3R5) represent the majority of the effort in getting this application ported to run on OpenShift:

    set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
    set :bind, ENV['OPENSHIFT_RUBY_IP'] if ENV['OPENSHIFT_RUBY_IP']

    Last month, when I had originally looked into making this application available on OpenShift, we were missing support for setting custom environment variables from outside a hosted application. In the last week, we've added that feature along with quite a few more.

    Developers can now define custom environment variables as a part of their application creation process:

    rhc app create citibikes ruby-1.9 --env CITIBIKE_NEARBY_STATIONS="268,257,2010" --from-code=https://github.com/edgar/citibikenyc_dashboard.git
  4. ryanj revised this gist Sep 5, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,8 @@ I did some quick work to modify an existing [Citibike Dashboard](https://github.
    ## CitibikeNYC Dashboard
    Edgar's citibike dashboard uses his own [Citibike ruby client library](https://github.com/edgar/citibikenyc) to fetch data on the status of selected local bike hubs nearby. ***Very impressive!***

    ###### Putting OpenShift's New Custom Environment Variables To Work

    [The following two lines](https://github.com/edgar/citibikenyc_dashboard/commit/72071d99474743903366e0deecb6421675054b12#L3R5) represent the majority of the effort in getting this application ported to run on OpenShift:

    set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
  5. ryanj revised this gist Sep 3, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -35,8 +35,8 @@ Edgar's citibike dashboard uses his own [Citibike ruby client library](https://g

    [The following two lines](https://github.com/edgar/citibikenyc_dashboard/commit/72071d99474743903366e0deecb6421675054b12#L3R5) represent the majority of the effort in getting this application ported to run on OpenShift:

    <ruby>set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
    set :bind, ENV['OPENSHIFT_RUBY_IP'] if ENV['OPENSHIFT_RUBY_IP']</ruby>
    set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
    set :bind, ENV['OPENSHIFT_RUBY_IP'] if ENV['OPENSHIFT_RUBY_IP']

    Last month, when I had originally looked into making this application available on OpenShift, we were missing support for setting custom environment variables from outside a hosted application. In the last week, we've added that feature along with quite a few more.

  6. ryanj revised this gist Sep 3, 2013. 1 changed file with 16 additions and 16 deletions.
    32 changes: 16 additions & 16 deletions nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -5,26 +5,26 @@

    [BetaNYC](http://www.meetup.com/betanyc/) is one of a growing number of civic-minded technology groups that are working to improve their community by rapidly prototyping software solutions that address common problems in their neighborhood. These groups are often associated with the larger [Code for America](http://codeforamerica.org/) organization through their volunteer-based, technology [Brigade](http://brigade.codeforamerica.org/) program.

    Code for America promotes civic engagement across the country with the goal of improving the relationship between citizens and their government. Their mission statement reads: "[Code for America envisions a government that works by the people, for the people, in the 21st century](http://www.codeforamerica.org/about/)".
    Code for America promotes civic engagement across the country, with the goal of improving the relationship between citizens and their government. Their mission statement reads: "[Code for America envisions a government that works by the people, for the people, in the 21st century](http://www.codeforamerica.org/about/)".

    As someone who frequently feels rather powerless about the direction in which our government is heading, these aspirations give me hope, and inspire me to act.
    As someone who frequently feels rather detached and powerless regarding the direction in which our government is heading, these aspirations give me hope, and inspire me to act.

    I joined Oakland California's [OpenOakland](http://openoakland.org/) Brigade quite some time ago, and [have participated in plenty of](https://www.openshift.com/blogs/seven-steps-to-hackathon-success) [civic hacking events](http://hackforchange.org/) from out on the West Coast since. However, this was my first event on the East Coast, and my first look at CitiBike's data.
    I joined Oakland California's [OpenOakland](http://openoakland.org/) Brigade last year, and [have participated in plenty of](https://www.openshift.com/blogs/seven-steps-to-hackathon-success) [civic hacking events](http://hackforchange.org/) from out on the West Coast since. However, this was my first event on the East Coast, and my first look at CitiBike's data.

    ## Citibike's Open Data
    A large part of these "[civic hacking](http://brigade.codeforamerica.org/civic-coding)" efforts really just involve using modern, open source software tools and data analysis techniques to help gain a greater understanding of the information stored in public records, and in other data made publicly available by civic-focused organizations and groups.

    For these folks, the term **hacking** does not imply theft. Instead, it usually represents a creative, innovative, or unexpected modification or reuse of existing tools and/or information.
    For these folks, the term **hacking** does not imply theft. Instead, it usually represents working toward a creative, innovative, or unexpected reuse of readily available tools, goods, or information. Or more generally, to fix, upgrade, or improve.

    This night's theme involved making use of the public data from New York's CitiBike bike sharing program - a popular topic, which filled the night's meeting space to capacity.
    This night's theme focused on making use of the public data from New York's CitiBike bike sharing program - a popular topic, which filled the night's meeting space to capacity.

    The meeting format was familiar: We started off with ten minutes of introductory announcements, followed by an hour of fast, 5-minute presentations from local developers who had prepared an application demo to share. The final two hours of the event were left open for general collaboration, team building, and more *hacking*.

    [Noel Hidalgo](https://twitter.com/noneck), the NYC Brigade Captain, posted an excellent recap of the night's project presentations [on the Code for America blog](http://codeforamerica.org/2013/08/02/notes-from-the-field-betanyc-bikehack/).

    Representatives from groups such as the Department of Transportation, Socrata, and other large public and private sector organizations were also in attendance. These groups were not only there to promote the availability their own data sets, but they were also expected to be able to handle questions about the data, and to collect feedback about the quality and accessibility of the information.

    As a visitor from an outside city, I was really interested in seeing how we could make our successful apps more portable, allowing us to multiplying our wins by enabling other communities to quickly replicate and reuse our project code.
    As a visitor from another Brigade city, I was really interested in seeing how we could make our successful apps more portable, allowing us to multiply our wins by enabling other communities to quickly replicate and reuse our project code.

    As it turns out, the format of the publicly available NYC bike data is almost an exact match for the data provided by the bike sharing programs in Philadelphia and in Washington DC. This means that a single bike dashboard application (with some slight modifications), may be reusable in a wide variety of communities.

    @@ -54,26 +54,26 @@ Then, restart the application to load your new station id list:

    rhc app restart

    This is great because it allows me to run the upstream project source directly, without requiring any downstream modifications in order to configure the app for my needs.
    This is great because it allows me to run the upstream project source directly, without requiring any downstream modifications in order to configure the app for my needs.

    This leads to apps that are more maintainable, portable, and reusable, all while helping to improve security by keeping your source code free of application secrets and keys.
    Maintaining a clean and configurable upstream source for these projects should also help improve security by keeping secrets and keys out of the application source, and by providing a central location for people to collaborate and discuss security patches and other issues.

    A live demo of [my branch of the dashboard](https://github.com/ryanj/citibikenyc_dashboard) is available here: [http://citibike-shifter.rhcloud.com/](http://citibike-shifter.rhcloud.com/)

    To find out more about the newly added support for user-defined application variables, update your `rhc` command-line tools to the latest version, and use the included `help` command for additional usage information:
    For more information about the newly added support for user-defined application variables, update your `rhc` command-line tools to the latest version, and use the included `help` command to print the usage notes:

    gem update rhc
    rhc help env

    ## Civic innovation in your neighborhood
    ## Civic Innovation in Your Neighborhood
    The Brigade teams are hard at work on [a growing list of applications that can be quickly redeployed in your area](http://brigade.codeforamerica.org/applications). Let us know if you've developed a portable civic application, or if you've redeployed a civic app for use in your own neighborhood - We'd love to hear about it, and help you spread the word.

    My stop in NYC was the first in a series of visits with Code for America Brigade groups that we're planning over the coming months. Stay tuned, and hopefully we'll be stopping by at a brigade near you soon!

    Let us know if you're developing portable civic applications, or if you've [redeployed a civic app for use in your own neighborhood](http://brigade.codeforamerica.org/applications) - We'd love to hear about it and help you spread the word!
    My stop in NYC was the first in a series of Brigade visits that OpenShift has planned over the coming months. Stay tuned, and hopefully we'll be dropping by a brigade near you soon!

    ## What's Next?
    - [Spin up your own copy of the Citibike dashboard](http://citibike-shifter.rhcloud.com/) for use in your neighborhood.
    - Apply to have your civic application listed in to the [OpenShift Application Gallery](https://www.openshift.com/application-gallery).
    - Host your own [private Platform As a Service](https://engage.redhat.com/forms/contact-sales-openshift) (PaaS) by evaluating [OpenShift Enterprise](https://www.openshift.com/enterprise-paas).
    - [Spin up your own copy of the Citibike dashboard](http://citibike-shifter.rhcloud.com/)
    - [Join a Brigade near you!](http://brigade.codeforamerica.org/)
    - Apply to have your civic application listed in the [OpenShift Application Gallery](https://www.openshift.com/application-gallery).
    - Host your own [private Platform As a Service](https://engage.redhat.com/forms/contact-sales-openshift) (PaaS) by evaluating [OpenShift Enterprise](https://www.openshift.com/enterprise-paas), or by running your own copy our upstream source, [OpenShift Origin](http://openshift.github.io/).
    - Need Help? [Ask the OpenShift Community](https://www.openshift.com/forums) your questions in the forums.
    - Keep up to date on our latest community news by following the [@OpenShift](https://twitter.com/openshift) twitter account.
  7. ryanj created this gist Sep 2, 2013.
    79 changes: 79 additions & 0 deletions nyc-civic-innovation-citibike.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,79 @@
    ## Civic Hacking and Innovation
    <img style="float:right;padding-left:10px;padding-bottom:10px;width:25%;" src="https://www.openshift.com/sites/default/files/Fixed-gear-cogs.jpg" alt="NYC shifts civic innovation into high gear" title="NYC shifts civic innovation into high gear" />

    [Last month I stopped by](http://codeforamerica.tumblr.com/post/57035858146/openshift-meets-betanyc-a-cfabrigade-for-nyc) the [BetaNYC Hack Night](http://www.meetup.com/betanyc/events/126764182/) in New York to get a look at some of the latest civic innovation projects being developed on the East Coast.

    [BetaNYC](http://www.meetup.com/betanyc/) is one of a growing number of civic-minded technology groups that are working to improve their community by rapidly prototyping software solutions that address common problems in their neighborhood. These groups are often associated with the larger [Code for America](http://codeforamerica.org/) organization through their volunteer-based, technology [Brigade](http://brigade.codeforamerica.org/) program.

    Code for America promotes civic engagement across the country with the goal of improving the relationship between citizens and their government. Their mission statement reads: "[Code for America envisions a government that works by the people, for the people, in the 21st century](http://www.codeforamerica.org/about/)".

    As someone who frequently feels rather powerless about the direction in which our government is heading, these aspirations give me hope, and inspire me to act.

    I joined Oakland California's [OpenOakland](http://openoakland.org/) Brigade quite some time ago, and [have participated in plenty of](https://www.openshift.com/blogs/seven-steps-to-hackathon-success) [civic hacking events](http://hackforchange.org/) from out on the West Coast since. However, this was my first event on the East Coast, and my first look at CitiBike's data.

    ## Citibike's Open Data
    A large part of these "[civic hacking](http://brigade.codeforamerica.org/civic-coding)" efforts really just involve using modern, open source software tools and data analysis techniques to help gain a greater understanding of the information stored in public records, and in other data made publicly available by civic-focused organizations and groups.

    For these folks, the term **hacking** does not imply theft. Instead, it usually represents a creative, innovative, or unexpected modification or reuse of existing tools and/or information.

    This night's theme involved making use of the public data from New York's CitiBike bike sharing program - a popular topic, which filled the night's meeting space to capacity.

    The meeting format was familiar: We started off with ten minutes of introductory announcements, followed by an hour of fast, 5-minute presentations from local developers who had prepared an application demo to share. The final two hours of the event were left open for general collaboration, team building, and more *hacking*.

    [Noel Hidalgo](https://twitter.com/noneck), the NYC Brigade Captain, posted an excellent recap of the night's project presentations [on the Code for America blog](http://codeforamerica.org/2013/08/02/notes-from-the-field-betanyc-bikehack/).

    Representatives from groups such as the Department of Transportation, Socrata, and other large public and private sector organizations were also in attendance. These groups were not only there to promote the availability their own data sets, but they were also expected to be able to handle questions about the data, and to collect feedback about the quality and accessibility of the information.

    As a visitor from an outside city, I was really interested in seeing how we could make our successful apps more portable, allowing us to multiplying our wins by enabling other communities to quickly replicate and reuse our project code.

    As it turns out, the format of the publicly available NYC bike data is almost an exact match for the data provided by the bike sharing programs in Philadelphia and in Washington DC. This means that a single bike dashboard application (with some slight modifications), may be reusable in a wide variety of communities.

    I did some quick work to modify an existing [Citibike Dashboard](https://github.com/edgar/citibikenyc_dashboard) application which was originally written by local Brigade member, [Edgar Gonzalez](https://twitter.com/edgar).

    ## CitibikeNYC Dashboard
    Edgar's citibike dashboard uses his own [Citibike ruby client library](https://github.com/edgar/citibikenyc) to fetch data on the status of selected local bike hubs nearby. ***Very impressive!***

    [The following two lines](https://github.com/edgar/citibikenyc_dashboard/commit/72071d99474743903366e0deecb6421675054b12#L3R5) represent the majority of the effort in getting this application ported to run on OpenShift:

    <ruby>set :port, ENV['OPENSHIFT_RUBY_PORT'] if ENV['OPENSHIFT_RUBY_PORT']
    set :bind, ENV['OPENSHIFT_RUBY_IP'] if ENV['OPENSHIFT_RUBY_IP']</ruby>

    Last month, when I had originally looked into making this application available on OpenShift, we were missing support for setting custom environment variables from outside a hosted application. In the last week, we've added that feature along with quite a few more.

    Developers can now define custom environment variables as a part of their application creation process:

    rhc app create citibikes ruby-1.9 --env CITIBIKE_NEARBY_STATIONS="268,257,2010" --from-code=https://github.com/edgar/citibikenyc_dashboard.git

    The command output should include a live web URL where your application clone can be accessed.

    To update an existing OpenShift-hosted application clone with new list of station ids:

    rhc env set CITIBIKE_NEARBY_STATIONS="268,257,258" -a citibikes

    Then, restart the application to load your new station id list:

    rhc app restart

    This is great because it allows me to run the upstream project source directly, without requiring any downstream modifications in order to configure the app for my needs.

    This leads to apps that are more maintainable, portable, and reusable, all while helping to improve security by keeping your source code free of application secrets and keys.

    A live demo of [my branch of the dashboard](https://github.com/ryanj/citibikenyc_dashboard) is available here: [http://citibike-shifter.rhcloud.com/](http://citibike-shifter.rhcloud.com/)

    To find out more about the newly added support for user-defined application variables, update your `rhc` command-line tools to the latest version, and use the included `help` command for additional usage information:

    gem update rhc
    rhc help env

    ## Civic innovation in your neighborhood

    My stop in NYC was the first in a series of visits with Code for America Brigade groups that we're planning over the coming months. Stay tuned, and hopefully we'll be stopping by at a brigade near you soon!

    Let us know if you're developing portable civic applications, or if you've [redeployed a civic app for use in your own neighborhood](http://brigade.codeforamerica.org/applications) - We'd love to hear about it and help you spread the word!

    ## What's Next?
    - [Spin up your own copy of the Citibike dashboard](http://citibike-shifter.rhcloud.com/) for use in your neighborhood.
    - Apply to have your civic application listed in to the [OpenShift Application Gallery](https://www.openshift.com/application-gallery).
    - Host your own [private Platform As a Service](https://engage.redhat.com/forms/contact-sales-openshift) (PaaS) by evaluating [OpenShift Enterprise](https://www.openshift.com/enterprise-paas).
    - Need Help? [Ask the OpenShift Community](https://www.openshift.com/forums) your questions in the forums.
    - Keep up to date on our latest community news by following the [@OpenShift](https://twitter.com/openshift) twitter account.