Skip to content

Instantly share code, notes, and snippets.

View jufemaiz's full-sized avatar
🔌
CTO at @enosi

Joel Courtney jufemaiz

🔌
CTO at @enosi
View GitHub Profile
@jufemaiz
jufemaiz / envvars
Created May 8, 2014 01:58
AWS EC2 Elastic Beanstalk Instance (Ruby Puma)
# /opt/elasticbeanstalk/containerfiles/envvars
# Default environment variables for Elastic Beanstalk
export EB_ROOT=/opt/elasticbeanstalk
export EB_CONFIG_FILE=$EB_ROOT/deploy/configuration/containerconfiguration
export EB_CONFIG_SOURCE_BUNDLE=$EB_ROOT/deploy/appsource/source_bundle
export EB_CONFIG_APP_BASE=/var/app
export EB_CONFIG_APP_SUPPORT=$EB_CONFIG_APP_BASE/containerfiles
export EB_CONFIG_APP_ONDECK=$EB_CONFIG_APP_BASE/ondeck
export EB_CONFIG_APP_CURRENT=$EB_CONFIG_APP_BASE/current
### Keybase proof
I hereby claim:
* I am jufemaiz on github.
* I am jcourtneycozero (https://keybase.io/jcourtneycozero) on keybase.
* I have a public key ASCy3Xmfk_uMgj5PAwT-YPTDIQBEkYJuLAWsV_ybhnuU7Qo
To claim this, I am signing this object:
@jufemaiz
jufemaiz / 1_README.md
Last active January 24, 2017 10:45
Rails + GIT Gems

In order to deal with GIT based gems, you'll need to make add some additional .ebextensions/*.config files.

  1. Support GIT in your EC2 instance;
  2. Backup the existing bundle command
  3. Bootstrap your rails project to add in your vendor directory to the shared environment
  4. Replace your bundle_install with a better bundle_install_deployment approach

Please note that these are placed in your Rails applications .ebextensions folder.

@jufemaiz
jufemaiz / measurement_datum.rb
Created September 21, 2016 09:20
A tale of Upsert issues
class MeasurementDatum
belongs_to :measurement_point
# Schema
# - measurement_point_id, integer
# - recorded_at, datetime
# - value, double
end
$("ol.stream-items").bind("DOMSubtreeModified", function() {
alert('Subtree modified');
$('li.stream-item').each(
function(i,el){
if( undefined !== $(el).children('.tweet').attr('data-retweeter') ) {
$(el).css('display','none').addClass('retweet-quiet');
}
}
);
});
@jufemaiz
jufemaiz / histogram_table_timeofday.js
Created August 14, 2013 01:49
Inserts a table based histogram of time data from an object data of structure { 'time_of_day':value }
// Inserts a table based histogram of time data from an object data of structure { 'time_of_day':value }
// @param data[Object] Time of day data object data of structure { 'time_of_day':value }
// @param string|node Node to append to
// @return jQuery[Object] the table's jquery object.
function histogram_table_timeofday(data,parentNode) {
var le_table = $('<table id="histogram" style="width: 100%"><thead><tr><th scope="col" style="width: 40px;">Time of Day</th><th scope="col">Count</th></thead><tbody></tbody></table>');
var max = 0;
for(var key in data) {
if(data[key] > max) { max = data[key]; }
}
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Colin's Questions</title>
<meta name="description" content="">
times prices status: base power: base status: peaker power: peaker power: wind load power: Ireland
2010-04-27 00:00:00 30.0 1.0 2197.0 -0.0 0.0 303 2500
2010-04-27 00:15:00 30.0 1.0 2178.0 1.0 0.0 311 2489
2010-04-27 00:30:00 30.0 1.0 2092.0 1.0 0.0 340 2432
2010-04-27 00:45:00 30.0 1.0 2012.0 1.0 0.0 360 2372
2010-04-27 01:00:00 30.0 1.0 1975.0 1.0 0.0 345 2320
2010-04-27 01:15:00 30.0 1.0 1918.0 1.0 0.0 348 2266
2010-04-27 01:30:00 30.0 1.0 1824.0 1.0 0.0 411 2235
2010-04-27 01:45:00 30.0 1.0 1804.0 1.0 0.0 405 2209
2010-04-27 02:00:00 30.0 1.0 1759.0 1.0 0.0 411 2170