Skip to content

Instantly share code, notes, and snippets.

View retr0h's full-sized avatar
💭
(✖╭╮✖)

נυαη נυαηѕση retr0h

💭
(✖╭╮✖)
  • Los Angeles, CA
  • 22:40 (UTC -12:00)
View GitHub Profile
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
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)
- name: Install packages
package: name={{ item }}
with_flattened:
- "common_{{ ansible_os_family }}_base_packages"
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
##
# 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
@retr0h
retr0h / gist:32421
Created December 5, 2008 18:00 — forked from jashmenn/gist:6206
# == WHAT
# Simple script for growl notifications in irssi
#
# == WHO
# Nate Murray 2008
#
# == CONFIG
# /SET growl_on_regex [regex]
# /SET growl_channel_regex [regex]
#
@retr0h
retr0h / gist:66008
Created February 17, 2009 21:47 — forked from amikula/gist:65995
# 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
@retr0h
retr0h / gist:68809
Created February 23, 2009 05:03
ActionMailer Timeouts
### 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
### lib/tasks/app.rake
begin
require 'vlad'
Vlad.load :scm => :git, :web => :apache
rescue LoadError
puts $!
end
### Extending 'vlad:update' with 'gems:geminstaller'
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"))