cloud_controller/app/models/app.rb
def set_defaults
- self.metadata ||= {}
+ self.metadata = {} if new_record?
end
- ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
| # yield chunks (Array) of the full query to a block | |
| # generates new Collections via self.model.all | |
| # which has the advantage of dropping scope on | |
| # hydrated objects | |
| def block_batches(chunksize, &block) | |
| new_options = self.query.options.dup | |
| total = new_options[:limit] || self.count | |
| new_options[:limit] = chunksize | |
| new_options[:offset] = 0 |
| apt-get install -qqy gdb | |
| cat > ~/.gdbinit <<EOF | |
| define eval | |
| call(rb_p(rb_eval_string_protect(\$arg0,(int*)0))) | |
| end | |
| define redirect_stdout | |
| call rb_eval_string("\$_old_stdout, \$stdout = \$stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); \$stdout.sync = true") |
| ==> actionmailer/CHANGELOG <== | |
| ## Rails 3.0.18 | |
| ## Rails 3.0.17 (Aug 9, 2012) | |
| * No changes. | |
| ## Rails 3.0.16 (Jul 26, 2012) | |
| * No changes. |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <fcntl.h> | |
| #include <sys/stat.h> | |
| #include <sys/ioctl.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| void print_help(char *prog_name) { | |
| printf("Usage: %s [-n] DEVNAME COMMAND\n", prog_name); |
| #!/usr/bin/env bash | |
| # | |
| # Functions | |
| ok() { | |
| echo -e '\e[32m'$1'\e[m'; | |
| } | |
| die() { | |
| echo -e '\e[1;31m'$1'\e[m'; exit 1; |
| #!/bin/bash | |
| set -e | |
| function init { | |
| [[ ! -f /tmp/updated ]] && apt-get update -y && touch /tmp/updated | |
| myip=$(ifconfig eth0 | awk '/inet addr/ {split ($2,A,":"); print A[2]}') | |
| } |
| #!/usr/bin/env python | |
| """ | |
| monitor a directory: | |
| - id files via genpuid (musicdns) | |
| - update ID3 tags and rewrite filename | |
| REQUIREMENTS: | |
| 1) signup for an account and API key here: | |
| https://secure.musicip.com/dns/index.jsp |
| #!/usr/bin/env python | |
| import sys | |
| import os | |
| import pickle | |
| import logging | |
| import simplejson | |
| import getopt | |
| import inspect | |
| import types |
| #!/usr/bin/env python | |
| import os | |
| import threading | |
| import time | |
| import socket | |
| import SocketServer | |
| import collections | |
| import sys | |
| import json |