Skip to content

Instantly share code, notes, and snippets.

@mark-d-holmberg
mark-d-holmberg / .vimrc
Last active August 7, 2019 17:30
My .vimrc Config File for ViM
set nowrap
set nu
set cindent
set ts=2
set shiftwidth=2
set autowrite
hi Search ctermbg=6 guibg=LightBlue
set hlsearch
" set noexpandtab
set expandtab
@mark-d-holmberg
mark-d-holmberg / close_stupid_gadgets.js
Created August 6, 2019 15:54
Close stupid JIRA gadgets
$("a.minimization").each(function(index) {
$(this).trigger('click');
});
find . -name ".DS_Store" -print | xargs rm
@mark-d-holmberg
mark-d-holmberg / Hotkeys.ini
Created July 28, 2018 05:56
Fallout 4 Hotkeys
[Macros]
hot=cqf hotkeys activate
[Hotkeys]
F2=
F3=
Shift-1=hot 1
Shift-2=hot 2
Shift-3=hot 3
Shift-4=hot 4
bash_prompt_command() {
local K="\[\033[0;30m\]" # black
local R="\[\033[0;31m\]" # red
local G="\[\033[0;32m\]" # green
local Y="\[\033[0;33m\]" # yellow
local B="\[\033[0;34m\]" # blue
local M="\[\033[0;35m\]" # magenta
local C="\[\033[0;36m\]" # cyan
local W="\[\033[0;37m\]" # white
local NONE="\[\033[0m\]"
@mark-d-holmberg
mark-d-holmberg / md5sum_directory_ruby.rb
Created May 4, 2017 18:11
MD5Sum a Directory in Ruby.
require 'digest'
files = Dir["#{Dir.pwd}/db-migrate/**/*.rb"]
sorted = files.map { |file| Digest::MD5.file(file).hexdigest }.sort
content = ""
sorted.each { |k| content << "#{k}\n" }
Digest::MD5.hexdigest(content)
@mark-d-holmberg
mark-d-holmberg / simple_form.rb
Created January 22, 2016 00:22
Simple Form Bootstrap Ruby Engine Config
# lib/my-engine/simple-form.rb
require 'simple_form'
# https://gist.github.com/mark-d-holmberg/78f2909de5b59a09329c
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
# complete input. You can remove any component from the
# wrapper, change the order or even add your own to the
@mark-d-holmberg
mark-d-holmberg / panels.sublime-snippet
Created January 4, 2016 20:08
Sublime Snippet : Panels
<snippet>
<content><![CDATA[
.panel.panel-default
.panel-heading
%h4 ${1:General Information}
.panel-body
.table-responsive
${2:Content Here}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
@mark-d-holmberg
mark-d-holmberg / maintenance
Created December 30, 2013 15:57
This is an apache file for turning on Maintenance Mode
RewriteEngine On
RewriteLog /var/log/apache2/jrop-rewrite.log
RewriteLogLevel 0
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
@mark-d-holmberg
mark-d-holmberg / spec_helper.rb
Last active December 25, 2015 15:19 — forked from pauljamesrussell/spec_helper.rb
Allows it to test accepts_nested_attributes_for with associations that are a `has_one`
# See: https://gist.github.com/1353500
# Use: it { should accept_nested_attributes_for(:association_name).using_has_one(true).and_accept({valid_values => true}).but_reject({ :reject_if_nil => nil })}
RSpec::Matchers.define :accept_nested_attributes_for do |association|
match do |model|
@model = model
@nested_att_present = model.respond_to?("#{association}_attributes=".to_sym)
if @nested_att_present && @reject
model.send("#{association}_attributes=".to_sym,[@reject])
@reject_success = model.send("#{association}").empty?
end