Skip to content

Instantly share code, notes, and snippets.

View ryanj's full-sized avatar
💭
LGTM

ryan jarvinen ryanj

💭
LGTM
View GitHub Profile
@ryanj
ryanj / gist:4446113
Last active June 12, 2016 09:41
How to keep secrets out of your public source by using OpenShift ENV variables

Keep secrets out of your source when working with OpenShift

These steps assume that you already have a working app on OpenShift. If you need help, you can get started here!

1. Find your app's ssh address

rhc app show YOUR_APP_NAME

2. ssh into your gear to set your environment variables:

ssh YOUR_APP_SSH_URL

@ryanj
ryanj / rhclone.sh
Created January 22, 2013 19:43
Add this to your .bashrc to run "rhclone $app_name $cart_type $git_uri" to quickly initialize a gear with an openshift-compatible cart (via a git repo uri)
#Add the following lines to your `~/.bashrc` to run "rhclone $app_name $cart_type $git_uri"
# in order to quickly initialize an openshift gear
# with an openshift-compatible cart (via a git repo uri).
#
# 'git' and 'rhc' command-line tools are required:
function rhclone()
{
rhc app create $1 $2 && cd $1 && git remote add upstream -m master $3 && git pull -s recursive -X theirs upstream master && git push
}
export rhclone
@ryanj
ryanj / gist:4676419
Created January 30, 2013 20:09
full-text search box for your public static blog. just fill in YOUR_SITE_NAME
<div id='searchbox'>
<form action="http://google.com/" method="GET" onsubmit="document.getElementById('searchbox_input').value += ' site:<?= getenv('OPENSHIFT_APP_DNS'); ?>'; return true;">
  <input type="text" id="searchbox_input" name="q"/><input type="submit" value="Search"/>
</form>
</div>
<div id='searchbox'>
<form action="http://google.com/" method="GET" onsubmit="document.getElementById('searchbox_input').value += ' site:YOUR_SITE_NAME'; return true;">
  <input type="text" id="searchbox_input" name="q"/><input type="submit" value="Search">
@ryanj
ryanj / index.html
Created February 27, 2013 01:08 — forked from andrewxhill/index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Easy earthquakes</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://libs.cartocdn.com/cartodb.js/v2/cartodb.js"></script>
<style type="text/css">
body{
@ryanj
ryanj / openshift.npm.md
Last active November 22, 2017 19:55
A Git-based workflow for making your existing Open Source node.js application OpenShift-compatible.

Want to deploy an existing node.js Github project on OpenShift?

Give this recipe a try:

Add our OpenShift starter-code to your existing GitHub-hosted node.js application code:

cd $YOUR_PROJECT_FOLDER # This script assumes that your project is a git repo, with a git remote hosted on github.com
git remote add upstream -m master git@github.com:ryanj/nodejs-custom-version-openshift.git
git pull -s recursive upstream master # merge in a basic OpenShift skeleton
@ryanj
ryanj / php_parks.md
Last active December 25, 2015 17:59
Spatial mapping with PHP, Silex, MongoDB, Leaflet, and Open Street Maps.

Open Source Mapping with PHP and MongoDB

In response to Steve's call for a shift toward civic-focused applications that are a better suited for adoption and maintenance by PHP-friendly IT departments, I've momentarily set aside OpenShift's shiny new nodejs-0.10 cartridge in order to show you how easy it is to write a basic single-page mapping application in PHP.

Those of you who are familiar with Steve's mapping quickstarts may recognize this application as a port of his own MongoDB-Python-Flask example which uses MongoDB's spatial features to perform a classic bounding-box query.

*Project source: [https://github.com/openshift-quickstart/silex-mongodb-pa

@ryanj
ryanj / README.md
Last active December 25, 2015 17:59
an open source ribbon for OpenShift sites
@ryanj
ryanj / Pushit.sh
Last active August 29, 2015 13:56 — forked from nquinlan/Pushit.sh
pushit command, modified for linux (vlc / cvlc)
# in your .bash_profile / .bashrc
alias pushit='git push && cvlc http://www.youtube.com/watch?v=vCadcBR95oU'
# to get the file into your .bash_profile
echo "alias pushit='git push && cvlc http://www.youtube.com/watch?v=vCadcBR95oU'" >> ~/.bash_profile
@ryanj
ryanj / .openshift\action_hooks\pre_build_nodejs
Last active May 24, 2016 13:57
Include support for packaging globally installable npm modules, or other executables, locally within a project's source (node_modules/.bin/)
#!/bin/bash
# Projects which rely on npm modules which are normally installed using "npm install -g"
# can make those dependencies available on OpenShift by including this file in their project source.
# Add this content to your project as ".openshift/action_hooks/pre_build_nodejs"
# Then, save your npm dependencies locally (without the '-g' flag):
# > npm install module_name --save
# Finally, add and commit your changes:
@ryanj
ryanj / cartridge-workshop
Created June 8, 2014 01:58
OpenShift Cartridge Authoring Workshop
<section>
<section>
<img style="disply:block;border:none;background:none;" alt='OpenShift-logo' src='../shared/img/OpenShift_Horizontal_RGB_Reverse.png'/>
<h1>Cartridge Authoring</h1>
<h1>WorkShop</h1
<br/>
<p><a href='http://bit.ly/1jAgPYh'>bit.ly/1jAgPYh</a></p>
</section>
<section id='presented-by'>
<div>presented by</div>