Skip to content

Instantly share code, notes, and snippets.

FUNCTION neosnippet#init#_initialize()
Called 1 time
Total time: 2.880206
Self time: 0.000110
count total (s) self (s)
1 0.000004 let s:is_initialized = 1
1 0.529526 0.000067 call s:initialize_script_variables()
1 0.012750 0.000016 call s:initialize_others()
let g:neocomplete#enable_at_startup = 1
""" LEGACY when using neocoplcache (no Lua)
"let g:neocomplcache_enable_at_startup = 1
"let g:neocomplcache_snippets_dir='~/.vim/bundle/vim-snippets/snippets'
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
{
"_id" => "_design/Foo",
"language" => "javascript",
"views" => {
"by_name" => {
"map" => "function(doc) {\n if ((doc['type'] == 'Foo') && (doc['name'] != null)) {\n emit(doc['name'], null);\n }\n}\n"
},
"by_tag" => {
"map" => "function(doc) {\n if ((doc['type'] == 'Foo') && (doc['tag'] != null)) {\n emit(doc['tag'], null);\n }\n}\n"
},
{
"_sync": {
"rev": "9-e41acebf2f28b630dd39842c7a7ff625",
"sequence": 194,
"history": {
"revs": [
"1-1a599e6cbbdee78cda1cac87a0055d5a",
"2-484a8bf6e3c4618b5a61bad37d8be150",
"4-b35a1cd9ed8519c649f3d44a18792c27",
"5-e9e0126ed3d91c9c050c4cea76b705cf",
> chruby system
> /opt/chef/bin/knife bootstrap ulises --sudo -x vagrant -P vagrant -N "target1" -p 3333
Bootstrapping Chef on ulises
ulises /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-log-1.4.1/lib/mixlib/log.rb:97:in `level=': Log level must be one of :debug, :info, :warn, :error, or :fatal (ArgumentError)
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/lib/chef/application.rb:119:in `configure_logging'
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/lib/chef/application/client.rb:239:in `configure_logging'
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/lib/chef/application.rb:65:in `reconfigure'
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/lib/chef/application/client.rb:194:in `reconfigure'
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/lib/chef/application.rb:70:in `run'
ulises from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.18.2/bin/chef-client:26:in `<top (required)>'
require 'virtus'
# This Works!
class User
include Virtus.model
attribute :name, String
attribute :group, String
end
# Class User trying to make private attributes
# unicorn
description "unicorn ruby app server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [!2345]
env WORKDIR=/data
env PIDFILE=/data/tmp/pids/unicorn.pid
env CFGFILE=/data/config/unicorn.rb
@fgarcia
fgarcia / git.cap
Created March 10, 2014 16:04 — forked from corny/git.cap
# Save this file as lib/capistrano/tasks/git.cap
namespace :git do
desc 'Copy repo to releases'
task create_release: :'git:update' do
on roles(:all) do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :clone, '-b', fetch(:branch), '--recursive', '.', release_path
end
@fgarcia
fgarcia / long_lines.vim
Created March 22, 2014 10:23
Highlight long lines (>80) and provide a toggle command
" Highlight long lines (>80)
autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929
autocmd BufEnter * match OverLength /\%81v.*/
autocmd BufEnter * let w:long_line_match = 1
fu! LongLineHighlightToggle()
highlight OverLength ctermbg=darkgrey guibg=#592929
if exists('w:long_line_match')
match OverLength //
@fgarcia
fgarcia / gist:9854667
Created March 29, 2014 13:41
Padrino Helper Testing

There is great introduction here:

http://wikimatze.de/testing-helpers-in-padrino.html

However do not forget that helpers are a Sinatra feature, so you might want to search for "sinatra helper testing":

http://stackoverflow.com/a/8575684

Both links are the best way for your "spec/unit" tests. However once my own helpers evolve, I start depending on other helpers (Padrino::Helpers) and features/variables/extensions from my Padrino::Application.