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
# Copyright (c) 2008 Nicholas A. Evans | |
# http://ekenosen.net/nick/devblog/2008/12/better-progress-bar-for-rspec/ | |
# | |
# With some tweaks (slow spec profiler, growl support) | |
# By Nick Zadrozny | |
# http://gist.github.com/71340 | |
# | |
# Further tweaks (formatador, elapsed time instead of eta) | |
# By geemus (Wesley Beary) | |
# http://gist.github.com/266222 |
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
# Copyright (c) 2008 Nicholas A. Evans | |
# http://ekenosen.net/nick/devblog/2008/12/better-progress-bar-for-rspec/ | |
# | |
# With some tweaks (slow spec profiler, growl support) | |
# By Nick Zadrozny | |
# http://gist.github.com/71340 | |
# | |
# Further tweaks (formatador, elapsed time instead of eta) | |
# By geemus (Wesley Beary) | |
# http://gist.github.com/266222 |
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 'socket' | |
require 'syslog' | |
require 'logger' | |
require 'hoptoad_notifier' | |
# TcpSyslog is used are a dead-simple replacement for | |
# syslog ruby libs. None of them is able to send logs | |
# to a remote server, and even less in TCP. | |
# | |
# Example: |
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 InsertTabWrapper() | |
let col = col('.') - 1 | |
if !col || getline('.')[col - 1] !~ '\k' | |
return "\<tab>" | |
else | |
return "\<c-p>" | |
endif | |
endfunction | |
inoremap <tab> <c-r>=InsertTabWrapper()<cr> |
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
# re: capistrano-2.6.0/lib/capistrano/recipes/deploy/strategy/remote.rb | |
require 'capistrano/recipes/deploy/strategy/base' | |
module Capistrano | |
module Deploy | |
module Strategy | |
# An abstract superclass, which forms the base for all deployment | |
# strategies which work by grabbing the code from the repository directly | |
# from remote host. This includes deploying by checkout (the default), |
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 ruby | |
# | |
# Forking example using pipes to communicate from child processes | |
def log(msg) | |
case msg | |
when Array then msg.each {|m| log(" #{m}") } | |
else | |
puts "[#{Time.now}][#{$$}] #{msg}" | |
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
#!/bin/bash | |
# | |
# Hack to extract stats for a file including the actual creation time | |
# | |
# Uses debugfs which includes the crtime value in it's output: | |
# | |
# Inode: 23072101 Type: regular Mode: 0664 Flags: 0x80000 | |
# Generation: 1861227769 Version: 0x00000000:00000001 | |
# User: 1000 Group: 1000 Size: 0 | |
# File ACL: 0 Directory ACL: 0 |
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
irb> RUBY_VERSION | |
=> "1.9.3" | |
# it's 1.9.3-p374 if you wanna get picky.. | |
> JSON::VERSION | |
=> "1.5.4" | |
# So I have some json, from the body of a RestClient response that looks something like this: | |
irb> json = "{\"name\":\"Centrale Laiti\\u00e8re\"}" | |
=> "{\"name\":\"Centrale Laiti\\u00e8re\"}" |
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
# {{ansible_managed}} | |
127.0.0.1 localhost.localdomain localhost | |
::1 localhost6.localdomain6 localhost6 | |
{% for item in groups['all'] %} | |
{% set ip = next(ip for ip in hostvars[item]['ansible_all_ipv4_addresses'] if ip.find("10.") == 0, hostvars[item]['ansible_default_ipv4']) %} | |
{% if ip %} | |
{{ ip }} {{ item }} | |
{% endif %} | |
{% endfor %} |
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
param1={% for z in groups['zookeeper'] %}{% if loop.index > 1 %}:{% endif %}{{ hostvars[z]['ansible_fqdn'] }}:{{ port }}{% endfor %} | |
param2=something | |
param3=something | |