Skip to content

Instantly share code, notes, and snippets.

@tvon
tvon / init.vim
Created Nov 2, 2015
neovim init
View init.vim
" https://github.com/junegunn/vim-plug
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:plug_window = 'botright new | resize 10'
call plug#begin('~/.config/nvim/plugged')
"Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-jdaddy'
Plug 'tpope/vim-repeat'
@tvon
tvon / puppet.log
Created Oct 30, 2015
hq-vagrant manager debug
View puppet.log
2015-10-30 17:51:41 +0000 Puppet (err): Unable to set ownership to puppet:puppet for log file: /vagrant/puppet.log
2015-10-30 17:51:41 +0000 Puppet (debug): Runtime environment: puppet_version=4.2.1, ruby_version=2.1.6, run_mode=user, default_encoding=UTF-8
2015-10-30 17:51:41 +0000 Puppet (debug): Evicting cache entry for environment 'vagrant'
2015-10-30 17:51:41 +0000 Puppet (debug): Caching environment 'vagrant' (ttl = 0 sec)
2015-10-30 17:51:41 +0000 Puppet (debug): Evicting cache entry for environment 'vagrant'
2015-10-30 17:51:41 +0000 Puppet (debug): Caching environment 'vagrant' (ttl = 0 sec)
2015-10-30 17:51:41 +0000 Puppet (debug): Loading external facts from /opt/puppetlabs/puppet/cache/facts.d
2015-10-30 17:51:41 +0000 Puppet (info): Loading facts
2015-10-30 17:51:41 +0000 Puppet (debug): Loading facts from /tmp/vagrant-puppet/environments/vagrant/modules/apt/lib/facter/apt_reboot_required.rb
2015-10-30 17:51:41 +0000 Puppet (debug): Loading facts from /tmp/vagrant-puppet/environments/vagrant/modu
View gist:7e7d98c19597e6f37ef0
### Keybase proof
I hereby claim:
* I am tvon on github.
* I am tvon (https://keybase.io/tvon) on keybase.
* I have a public key whose fingerprint is 4FFD D907 7261 DB2E 0E7D DC66 8C40 C6BE D305 148A
To claim this, I am signing this object:
@tvon
tvon / SSLPoke.java
Last active Aug 29, 2015
JRuby/Java SSL issue
View SSLPoke.java
# from: https://gist.github.com/4ndrej/4547029
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
View rubocop-it.sh
#!/bin/bash
bundle exec rubocop --format clang --only $1 -a
git commit -p -m "$1"
View env.rb
Capybara.register_driver :poltergeist_inspector do |app|
Capybara::Poltergeist::Driver.new(app, :inspector => true)
end
Before('@javascript', '@inspector') do
Capybara.javascript_driver = :poltergeist_inspector
end
View simple-object-store.js
function SimpleObjectStore(storeName){
this.storeName = storeName;
this.changedEvent = "asq:" + this.storeName + "-changed";
}
SimpleObjectStore.prototype = {
constructor: SimpleObjectStore,
count: function(){
return this.get().length;
View git-html2haml.sh
#!/bin/bash
html2haml -ex $1 > tmp.haml
git mv $1 ${1/.erb/.haml}
mv tmp.haml ${1/.erb/.haml}
View aws-bootstrap.rb
require 'aws'
require 'json'
# Set the following environment variables:
#
# PROJECT_NAME=""
# AWS_ACCESS_KEY_ID=""
# AWS_SECRET_ACCESS_KEY=""
#
# If so desired:
@tvon
tvon / eval_in_file.rb
Created Jan 7, 2014
Dump code to be eval'd in a file so as to get a useful traceback if/when it fails.
View eval_in_file.rb
def eval_in_file(source, options={})
suffix = options[:suffix] || Time.now.strftime("%s%N")
path = options[:path] || "/tmp/"
result = nil
filename = "#{path}eval-#{suffix}.rb"
file = File.new(filename, 'w+')
file.write(source)
file.rewind
begin