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
config.middleware.insert_before ActionDispatch::ParamsParser, ::Rack::Robustness do |g| | |
g.no_catch_all | |
# you might need to replace this with JSON::ParserError, depending on your Rails configuration | |
# or you can catch both... | |
g.on(MultiJson::ParseError) { |ex| 400 } | |
g.content_type 'text/plain' | |
g.body{ |ex| ex.message } | |
g.ensure(true) do |ex| | |
env['rack.errors'].write(ex.message) | |
logger.warn(ex.message) |
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
# Have to use ActiveRecord so that New Relic shows it on all graphs. | |
# The push scope false stuff makes it so that you can track usage by model and overall. | |
if defined?(NewRelic) | |
module MongoMapperNewRelic | |
def self.included(model) | |
mm_class_methods = [ | |
:find, | |
:find!, | |
:paginate, | |
:first, |
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
# Just drop this little diddy in your app to get some (not perfect) information on query times and such | |
# This will eventually become an official plugin but for those who can't wait, enjoy. | |
if defined?(NewRelic) | |
module MMNewRelicTracing | |
def self.included(model) | |
model.metaclass.class_eval do | |
add_method_tracer :find, 'Database/#{self.name}/find' | |
add_method_tracer :find!, 'Database/#{self.name}/find!' | |
add_method_tracer :paginate, 'Database/#{self.name}/paginate' | |
add_method_tracer :first, 'Database/#{self.name}/first' |
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
#!/usr/bin/env zsh | |
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
setopt promptsubst | |
autoload -U add-zsh-hook | |
PROMPT_SUCCESS_COLOR=$FG[117] | |
PROMPT_FAILURE_COLOR=$FG[124] | |
PROMPT_VCS_INFO_COLOR=$FG[242] |
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
preload_app! | |
min_threads = Integer(ENV['MIN_THREADS'] || 0) | |
max_threads = Integer(ENV['MAX_THREADS'] || 5) | |
threads min_threads, max_threads | |
workers Integer(ENV['WORKER_COUNT'] || 3 ) | |
on_worker_boot do | |
ActiveSupport.on_load(:active_record) do |
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
$(document).ready(function() { | |
//init tab history with default tab 'table' | |
$(window).tabHistory('table'); | |
}); |
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
Set AppObj = CreateObject("Shell.Application") | |
If WScript.Arguments.Length=1 Then | |
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """" | |
Else | |
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash""" | |
End If |
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
You'll need proper development environment, learn about Ember CLI - https://www.youtube.com/watch?v=hygxGDjhGp8. | |
You might want to know about more about what's happening under the hood, watch Robert Jackson talk about Ember Magic - https://www.youtube.com/watch?v=OjqcI8KWesk. | |
Learn more about complex architecture in Ember https://www.youtube.com/watch?v=Kcij9lH2OyM | |
Learn more about Ember Data - https://www.youtube.com/watch?v=HL2bMjndviE. | |
You can get lost in the View layer, learn about Events and Actions from Luke Melia - https://www.youtube.com/watch?v=w6__hEUjqaw |
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
If you see... | |
Warning: Unbrewed dylibs were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when | |
building Homebrew formulae, and may need to be deleted. | |
Unexpected dylibs: | |
/usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib | |
Warning: Unbrewed .la files were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when |
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
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
-include_lib("kernel/include/file.hrl"). | |
-compile(export_all). | |
-define(LOG(S), io:format(S)). | |
-define(LOG(S,A), io:format(S,A)). | |
main(Dirs) -> | |
CodePath = case os:getenv("RIAK_LIB") of |
OlderNewer