This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// helper to create proper asset paths if an asset host is configured | |
App.assets = { | |
assets : { | |
<% AssetsUtil.images.each do |img| %> | |
"<%= img %>" : "<%= asset_path(img) %>", | |
<% end %> | |
}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rspecgrep() | |
{ | |
SPK_FILES=`find spec -type f -name "*_spec.rb" | grep $1` | |
echo $SPK_FILES | |
time rspec $SPK_FILES --format documentation | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add union_hack.rb to your project, for example at lib folder and ensure you're loading it on your application.rb file: | |
# You'll need to add something like that | |
config.autoload_paths += %W(#{config.root}/lib) | |
Then extend your favourite model with the module and you'll be able to do unions with unique records, sorted by any fields and limited in number of records (see my_timeline_method): | |
class Profile < ActiveRecord::Base | |
extend UnionHack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This diff is a modified version of a diff written by Arnis Lapsa. | |
[ The original can be found here: https://gist.github.com/ArnisL/6156593 ] | |
This diff adds support to tmux for 24-bit color CSI SRG sequences. This | |
allows terminal based programs that take advantage of it (e.g., vim or | |
emacs with https://gist.github.com/choppsv1/73d51cedd3e8ec72e1c1 patch) | |
to display 16 million colors while running in tmux. | |
The primary change I made was to support ":" as a delimeter as well |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
require 'json' | |
require 'uri' | |
require 'net/http' | |
gemfile(true) do | |
gem 'inflecto' | |
gem 'rom', github: 'rom-rb/rom' | |
gem 'rom-support', github: 'rom-rb/rom-support' | |
gem 'rom-http', github: 'rom-rb/rom-http' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Interreg.App.Audit.Application{ | |
using Domain.Model.Applications; | |
public class ApplicationAudit:Audit{ | |
public override void AttachHandlers(){ | |
On<AttachmentAdded>(e=>e.Source.LogEvent( | |
"Attachment named '{0}' added".With(e.Attachment.Name))); | |
On<AttachmentRemoved>(e=>e.Source.LogEvent( | |
"Attachment named '{0}' removed".With(e.Attachment.Name))); |
NewerOlder