Skip to content

Instantly share code, notes, and snippets.

View lxcodes's full-sized avatar

Alexander lxcodes

  • fh group
  • Erie, PA
View GitHub Profile
@SaladFork
SaladFork / ember-select.js
Last active August 29, 2015 14:08 — forked from Bouke/ember-select.js
Ember.Select allowing options to be disabled. Usage `{{view Ember.Select ... optionDisabledPath="content.disabled"}}` (Update to match `optionValuePath` and `optionLabelPath` implementation in Ember.js)
var get = Ember.get, set = Ember.set, computed = Ember.computed, defineProperty = Ember.defineProperty, observer = Ember.observer;
Ember.Select.reopen({
optionDisabledPath: null
});
Ember.SelectOption.reopen({
attributeBindings: ['disabled'],
init: function() {
@mxriverlynn
mxriverlynn / 1-form.html
Created September 26, 2011 20:48
progressive enhancement with backbone
<form id="foo">
Name: <input id="name"><button id="say">Say My Name!</button>
</form>
@ryanguill
ryanguill / receive-test.cfm
Last active December 13, 2015 16:39
the simple example for rabbitmq I set up. rabbitmq configuration was out-of-box, no changes, running on a virtualbox centos 6.3 vm with a gig of ram. Example of results:100000 messages sent in 13847 ms ( 7221.78089117 messages/second ). 100000 messages received in 20865 ms. ( 4792.71507309 messages/second )
<!---
--- NOTE: YOU NEED THE JAVA LIBRARY FROM HERE: http://www.rabbitmq.com/java-client.html
--- http://www.rabbitmq.com/tutorials/tutorial-one-java.html
--- https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/java/Recv.java
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;
@imesh
imesh / increase-boot2docker-disk.sh
Last active December 18, 2015 13:50
Increase Boot2Docker Disk
# Reference
# https://docs.docker.com/articles/b2d_volume_resize/
echo "Cloning existing disk..."
vboxmanage clonehd "/path/to/VirtualBox VMs/boot2docker-vm/boot2docker-vm.vmdk" "/path/to/VirtualBox VMs/boot2docker-vm/boot2docker-vm-v1.vdi" --format VDI --variant Standard
echo "Increasing disk size..."
vboxmanage modifyhd "/path/to/VirtualBox VMs/boot2docker-vm/boot2docker-vm-v1.vdi" --resize 40960
@modmedia
modmedia / mura-reset-iterator.cfm
Last active January 3, 2016 17:39
Reset the Mura iterator to output content multiple times
<!--- Sometimes you need to output the contents of an iterator multiple times. For example, for a slider with navigation, you may want to output the links as an unordered list and the images as divs --->
<cfoutput>
<cfset feed=$.getBean("feed").loadBy(name="Feed Name",siteID=$.event("siteid"))>
<cfset iterator=feed.getIterator()>
<cfif iterator.hasNext()>
<ul>
<!--- The list --->
@stevewithington
stevewithington / muraUserFeed.cfm
Last active January 3, 2016 21:49
Mura CMS : Example of how to create a user feed bean and loop over the user iterator to output data and extended attributes.
<cfscript>
// USER feed bean
userFeed = $.getBean('userFeed');
// if user(s) belong to a different site, specify desired siteid
// userFeed.setSiteID('someSiteID');
// if you know the groupid, you can filter that
// userFeed.setGroupID('someGroupID', false);
@stevewithington
stevewithington / muraTags.cfm
Last active January 3, 2016 22:19
Mura CMS : Example of how to obtain a recordset/query result of child content item's tags and their counts. As well as an example of how to filter a dynamic feed based on a specific tag.
<cfscript>
rsChildTags = $.getBean('contentGateway').getTagCloud(
siteid = $.event('siteid')
, parentid = $.content('contentid')
, categoryid = $.event('categoryid')
, taggroup = '' // could narrow down to a specific tag group as of 6.1
);
WriteDump(var=rsChildTags, label='rsChildTags');
@pauldenato
pauldenato / fileAttachmentLoop.cfc
Last active January 5, 2016 14:37
Loop the Files in a mura form
<!---Add to Site or Theme eventhandler.cfc--->
<cffunction name="onAfterFormSubmitSave">
<cfargument name="$">
<cfset var msg = "" />
<!---Get Most Recent Form ID--->
<cfset receipt = $.event('formDataBean').getFormResult() />
<!---Load Form Data--->
<cfset record = receipt />
#!/bin/bash
# This script is used by Icinga to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Icinga configuration.
#
# All variables that start with NAGIOS_ are provided by Icinga as
# environment variables when an notification is generated.
# A list of the env variables is available here: