Skip to content

Instantly share code, notes, and snippets.

View davydotcom's full-sized avatar

David Estes davydotcom

View GitHub Profile
@davydotcom
davydotcom / image-build-tutorial.md
Created September 27, 2017 19:54
Image Builder Tutorial for Morpheus

Creating an Image Build Task for CentOS 7.3

Morpheus 3 provides a brand new image builder service. This allows the user to build a new virtual image from scratch using only a base install CD and some scripts. This guide will help one better setup a Cent OS 7.3 Community Edition base image.

Requirements

  • Vmware VSPhere Cloud
  • Hypervisor Console Enabled
  • Sufficient storage space (100G recommended) in /var/opt/morpheus
  • DHCP Enabled Network within Vcenter
@davydotcom
davydotcom / store.js
Created January 14, 2014 16:23
Ember data working with grails style json
DS.RESTAdapter.reopen({
pathForType: function(type) {
return Ember.String.camelize(type);
}
});
App.ApplicationSerializer = DS.RESTSerializer.extend({
normalizePayload: function(type, payload) {
@davydotcom
davydotcom / UrlMappings.groovy
Last active January 2, 2016 11:59
Grails RESTFUL Delete Link
class SpudPermalinksUrlMappings {
static mappings = {
"/spud/admin/permalinks"(resources: 'permalinks', namespace: 'spud_admin')
"/spud/admin/permalinks/$id/delete"(controller: 'permalinks', action: 'delete', method: 'POST', namespace: 'spud_admin')
}
}
@davydotcom
davydotcom / gist:7050416
Created October 19, 2013 00:51
Retained Lines of code in your project
git ls-tree -r HEAD|sed -re 's/^.{53}//'|while read filename; do file "$filename"; done|grep -E ': .*text'|sed -r -e 's/: .*//'|while read filename; do git blame -w "$filename"; done|sed -r -e 's/.*\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\1/' -e 's/ +$//'|sort|uniq -c
@davydotcom
davydotcom / es.sh
Last active December 20, 2015 07:39
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.deb
sudo dpkg -i elasticsearch-0.90.2.deb
require 'oohlalog'
Oohlalog.api_key = "MY API KEY HERE"
logger = Oohlalog::Logger.new(10)
logger.add(Oohlalog::WARN,"My warning Message","My App Name")
<div class="modal hide fade in" id="modal">
{{outlet modal}}
</div>
if (Ext.firefoxVersion >= 18) {
var noArgs = [];
Ext.override(Ext.Base, {
callParent : function(args) {
var method, superMethod = (method = this.callParent.caller) &&
(method.$previous || ((method = method.$owner ?
method :
method.caller) && method.$owner.superclass[method.$name]));
def pm = org.codehaus.groovy.grails.plugins.PluginManagerHolder.pluginManager;
for ( plugin in pm.getAllPlugins() ) {
for ( wp in plugin.getWatchedResourcePatterns() ) {
if ( "plugins" == wp.getDirectory()?.getName() && "groovy" == wp.getExtension() )
wp.extension = "groovyXX";
}
}
<%customizable_form_for @test, :permissions => @current_user do |f|%>
<%=f.arrangeble_fields do%>
<%f.text_field :name%>
<%f.text_field :number%>
<%f.check_box :active%>
<%end%>
<%=field_set_tag "Custom Fields" do%>
<%=f.custom_fields :custom%>
<%end%>