Skip to content

Instantly share code, notes, and snippets.

View simonmd's full-sized avatar

Simon Rascovsky MD, M.Sc simonmd

View GitHub Profile
@scarfacedeb
scarfacedeb / 1.form.html.haml
Last active January 18, 2023 22:35
Form with multiple button in rails
/ Form excerpt
= f.button t(".save"), class: "btn"
= f.button t(".publish"), class: "btn", name: "publish"
= f.button t(".test"), class: "btn", name: "test"
@gunlock
gunlock / dcm4chee_run.sh
Last active August 29, 2015 14:05
dcm4chee run script
#!/bin/bash
export JBOSS_HOME=/home/pacs/dcm4chee
JBOSS_CLASSPATH=$JBOSS_HOME/bin/run.jar
JBOSS_NATIVE_DIR="$JBOSS_HOME/bin/native"
JBOSS_ENDORSED_DIRS="$JBOSS_HOME/lib/endorsed"
#enable remote access to jboss services and web interface
JBOSS_BIND_ADDR=${JBOSS_BIND_ADDR:-"0.0.0.0"}
@gunlock
gunlock / dcm4chee_daemon.sh
Last active August 29, 2015 14:05
dcm4chee daemon script for unbuntu
#!/bin/sh
# Author: Michael Gunlock 2014
### BEGIN INIT INFO
# Provides: dcm4chee
# Required-Start: \$remote_fs \$syslog
# Required-Stop: \$remote_fs \$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@gunlock
gunlock / dcm4chee_install.sh
Last active March 1, 2016 21:56
bash script to install dcm4chee and components on fresh Ubuntu 12.04 image
#!/bin/bash
function usage()
{
echo "Usage: $0 -u <Postgres_Username> -p <Password>"
}
USER=""
@theinventor
theinventor / teamviewer.rb
Created April 1, 2014 17:30
A quick ruby api wrapper for the teamviewer api
module Teamviewer
class Connector
attr_reader :client
def initialize
@client = connection(credentials)
end
@jgautsch
jgautsch / mirth_setup.md
Last active July 28, 2023 12:39
Setting up Mirth Connect for production

Mirth Server Setup

First create ec2 Ubuntu instance

Then install all the things needed for Mirth Connect (following this video: http://www.youtube.com/watch?v=omZyAO2naqs)

# Update Ubuntu
sudo aptitude update

# Safe upgrade of Ubuntu
sudo aptitude safe-upgrade
@TechFounder
TechFounder / simple_form_bootstrap3.rb
Last active January 2, 2016 13:09
Use this configuration in your initializer for simple_form if you're using bootstrap 3. https://github.com/gregbell/active_admin/issues/2703
SimpleForm.setup do |config|
config.input_class = 'form-control'
config.boolean_style = :nested
config.wrappers :bootstrap3, tag: 'div', class: 'form-group', error_class: 'has-error',
defaults: { input_html: { class: 'default_class' } } do |b|
b.use :html5
@cblavier
cblavier / embedded_findable.rb
Last active April 8, 2017 14:30
Helps to override find method for a Mongoid embedded document.
module Mongoid
# Helps to override find method in an embedded document.
# Usage :
# - add to your model "include Mongoid::EmbeddedFindable"
# - override find method with:
# def self.find(id)
# find_through(Book, 'chapter', id)
# end
module EmbeddedFindable
@adamico
adamico / collection_check_boxes_input.rb
Last active September 2, 2025 16:56 — forked from mattclar/simple_form.rb
This fork adds a custom horizontal form wrapper and merges append/prepend in a 'group' wrapper
#app/inputs/collection_check_boxes_input.rb
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput
def item_wrapper_class
"checkbox-inline"
end
end
@PWSdelta
PWSdelta / rspec_model_testing_template.rb
Last active July 29, 2025 13:52
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# This skeleton also assumes you're using the following gems:
#
# rspec-rails: https://github.com/rspec/rspec-rails