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
The 2014 g2k14 general Hackathon was taking place July in Ljubljana, | |
Slovenia, and attended by 49 developers. These developer gatherings | |
are used for very active work on OpenBSD’s source tree: to start new | |
patches and projects, to finish older ones, and for careful optimizations. | |
The security and code quality of OpenBSD is constantly being improved, | |
a continuous effort to gain perfection that reminds a lot of the Japanese | |
Shokunin. | |
http://www.openbsd.org/papers/httpd-asiabsdcon2015.pdf |
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
m = mock.Mock(name='name', | |
description='desc', | |
id='12345', | |
enabled=True) | |
g = {m.name: {'description': m.description, | |
'id': m.id}} | |
print g | |
print yaml.safe_dump(g, default_flow_style=False) |
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
- name: Install packages | |
package: name={{ item }} | |
with_flattened: | |
- "common_{{ ansible_os_family }}_base_packages" |
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 'singleton' | |
begin | |
require 'daemon_controller' | |
rescue LoadError | |
raise('FATAL: sudo gem install FooBarWidget-daemon_controller -s http://gems.github.com') | |
end | |
## | |
# sudo port install memcached | |
class DaemonMemcache |
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
## | |
# Start daemons. | |
config.after_initialize do | |
unless $0.match(/rake/) or (defined? DaemonMemcache and DaemonMemcache.instance.running?) | |
DaemonMemcache.instance.start rescue nil | |
at_exit do | |
DaemonMemcache.instance.stop rescue nil | |
end | |
end | |
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
# == WHAT | |
# Simple script for growl notifications in irssi | |
# | |
# == WHO | |
# Nate Murray 2008 | |
# | |
# == CONFIG | |
# /SET growl_on_regex [regex] | |
# /SET growl_channel_regex [regex] | |
# |
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
# Module for re-running commands from the history in irb and its ilk (script/console) | |
# Usage: | |
# history => view the history | |
# history 7 => rerun line 7 in the history | |
# history /foo/ => rerun the last line in the history matching /foo/ | |
# | |
# Just add this code into your ~/.irbrc. | |
# NOTE: Readline support is required for this to work. | |
module HistoryRepeats | |
class << self |
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
### lib/ruby_ext.rb | |
Net::SMTP.class_eval do | |
def initialize_with_timeouts(*args) | |
initialize_without_timeouts(*args) | |
@open_timeout = Emailer::OpenTimeout | |
@read_timeout = Emailer::ReadTimeout | |
end | |
alias_method_chain :initialize, :timeouts | |
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
### lib/tasks/app.rake | |
begin | |
require 'vlad' | |
Vlad.load :scm => :git, :web => :apache | |
rescue LoadError | |
puts $! | |
end | |
### Extending 'vlad:update' with 'gems:geminstaller' |
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 :spec do | |
desc "Report uncovered view templates." | |
task :missing_view_templates => :environment do | |
EXTENSION = ENV['extention'] || 'haml' | |
APP_VIEWS_DIR = File.join('app', 'views') | |
SPEC_VIEWS_DIR = File.join('spec', 'views') | |
Dir[File.join(Rails.root, "#{APP_VIEWS_DIR}/**/*.html.#{EXTENSION}")].each do |file| | |
file.match(%r{^#{File.join(Rails.root, APP_VIEWS_DIR)}/(.*)\.html.#{EXTENSION}$}) | |
puts $1 unless File.exists?(File.join(Rails.root, SPEC_VIEWS_DIR, "#{$1}.html.#{EXTENSION}_spec.rb")) |