Skip to content

Instantly share code, notes, and snippets.

View neilsmind's full-sized avatar

Neil Giarratana neilsmind

View GitHub Profile
@neilsmind
neilsmind / products.js
Last active August 25, 2017 21:50
Code issue with AWS SAM Local example in docs
'use strict';
// http://docs.aws.amazon.com/lambda/latest/dg/test-sam-local.html#sam-cli-simple-app
// This is the corrected code for the url above. Specifically, the example for
// product.js does not return`body`, `header`, nor `statusCode` for GET, PUT and
// DELETE methods. Original code is included at the bottom.
exports.handler = (event, context, callback) => {
let id = event.pathParameters.product || false;
@neilsmind
neilsmind / cloud9.sh
Created September 30, 2015 15:01 — forked from zachbrowne/cloud9.sh
Bash Script to Install Node.js and Cloud9 IDE on Ubuntu
#!/bin/sh
#######################################################
# Another great script by: #
# _ , _ #
# / ) _, _ |) /|/_) ,_ _ _ #
# / / | / |/\ | \/ | / \_| | |_/|/| |/ #
# /__/\/|_/\__/| |/|(_/ |/\_/ \/ \/ | |_/|_/ #
# (| #
# #
@neilsmind
neilsmind / _drug_fields.html.erb
Created January 27, 2014 20:17
snippet for formatted dates...
<tr class="nested-fields">
#How do I use strftime on the drug date field below?
<td><%= f.input :drug_date, as: :string, label: false, :input_html => { class: 'ui-date-picker' } %></td>
<td><%= f.input :drug, label: false %></td>
<td><%= f.input :drug_amount, label: false %></td>
<td><%= f.input :drug_problem, label: false %></td>
<td><%= f.input :drug_administrator, label: false %></td>
<td><%= link_to_remove_association "remove", f, class: "btn btn-primary btn-sm" %></td>
</tr>
function scan_preprocess_panels_pane(&$variables) {
if($variables['pane']->type == 'entity_field' && $variables['pane']->subtype == 'node:field_physical_address') {
watchdog('theme', 'I have a suggestion!');
$variables['theme_hook_suggestions'][] = 'panels-pane__address';
}
}
@neilsmind
neilsmind / recipe.snippet.rb
Created October 3, 2012 15:40
problem chef link
link "/vagrant/modules" do
to "/vagrant/www/sites/#{node[:my][:sitename]}.dev/modules"
end
@neilsmind
neilsmind / country_select.rb
Created August 27, 2012 02:14
Making carmen 1.x work with Formtastic (file under app/lib in my app)
class CountryInput < Formtastic::Inputs::CountryInput
def to_html
raise "To use the :country input, please install a country_select plugin, like this one: https://github.com/jamesds/country-select" unless builder.respond_to?(:country_select)
input_wrapping do
label_html <<
builder.country_select(method, priority_countries, input_options)
end
end
def priority_countries