Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'logger'
# rotatelogs required...
# http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
logger = Logger.new("|rotatelogs ./foo.log.%Y-%m-%d-%H 3600", 0, 0)
10.times do
logger.error "testing..."
#!/usr/bin/env ruby
# A pre-commit hook script to ensure that no local gem dependencies (gem 'asdf', path: '~/local')
# exist in your Gemfile before commiting.`
# Allows gems to be loaded from source within the current project, but not from outside.
puts 'Checking for local dependencies in your Gemfile.'
ROOT_PATH = File.expand_path('../../..', __FILE__)
begin
require 'rubygems'
gemfile = ENV['BUNDLE_GEMFILE'] || File.join(ROOT_PATH, 'Gemfile')
require 'bundler/setup' if File.exists?(gemfile)
Open3.pipeline_r(
%W[xmllint --xinclude --xmlout #{spine_file}],
# In order to clean up extraneous namespace declarations we need a second
# xmllint process
%W[xmllint --format --nsclean --xmlout -]) do |output, wait_thr|
open(codex_file, 'w') do |f|
IO.copy_stream(output, f)
end
end

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
upstream docker-registry {
server localhost:5000;
}
server {
# disabled until docker supports selfsigned certs
# listen 443;
server_name my.own.server.com;
access_log /var/log/nginx/docker-registry.access.log main;
error_log /var/log/nginx/docker-registry.error.log error;
God.watch do |w|
w.uid = "git"
w.gid = "git"
w.name = "camo"
w.pid_file = "/data/camo/tmp/camo.pid"
w.interval = 30.seconds
w.env = {
"PORT" => '8080',
"CAMO_KEY" => '0x24FEEDFACEDEADBEEFCAFE'
heat_template_version: 2013-05-23
description: >
A Heat template to add CoreOS instances to an existing network and configure them via cloud-init/cloud-config
parameters:
network_id:
type: string
label: Neutron network ID
description: ID of existing Neutron network to use
default: dd6de1d2-735e-4b94-963b-b79aae7bcf1a
image_id:

Keybase proof

I hereby claim:

  • I am Telmo on github.
  • I am romode (https://keybase.io/romode) on keybase.
  • I have a public key whose fingerprint is E87E 9932 CCB4 DC00 C595 46EB 9028 18E5 B126 ACBA

To claim this, I am signing this object:

@Telmo
Telmo / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console