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
app.route('/') | |
.html(function (req, resp) { | |
db.get('home', function(err, body) { | |
if (err) return resp.error(err) | |
console.log(templates.home(body)); | |
}) | |
.pipe(templates.home()) | |
.pipe(resp); | |
}) | |
.methods('GET') |
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
<?php | |
// Get the children | |
error_log(print_r($modx->resource->get('id'), 1)); // prints 1 | |
$children = $modx->resource->getMany('Children'); // returns children of 1 | |
if ($children) { | |
// Parse children | |
$retVal = '<ul>'; | |
foreach ($children as $child) { | |
$retVal .= '<li>Resource ' . $child->get('id') . ', child of resource ' . $child->get('parent') . '</li>'; |
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
# execute 'DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade' | |
include_recipe "postgresql" | |
include_recipe "postgresql::server" | |
include_recipe "postgresql::ruby" | |
include_recipe "database" | |
databases_file = "pgdatabases.tar.bz" | |
cookbook_file "/var/lib/postgresql/#{databases_file}" do | |
source databases_file |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.omnibus.chef_version = :latest | |
config.vm.box = "itvdev" | |
config.vm.network :private_network, ip: "10.42.42.2" | |
# config.vm.network :public_network |
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
-> cat Vagrantfile | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.omnibus.chef_version = :latest | |
config.vm.box = "itvdev" | |
config.vm.network :private_network, ip: "10.42.42.2" | |
# config.vm.network :public_network |
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
-> cat Vagrantfile | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.omnibus.chef_version = :latest | |
config.vm.box = "precise64" | |
config.vm.network :private_network, ip: "10.42.42.2" | |
# config.vm.network :public_network |
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
Sequel.migration do | |
change do | |
create_table :reports do | |
primary_key :id | |
column :name, String, null: false | |
column :product, String, null: false | |
column :category, String | |
column :topics, 'varchar[]' | |
column :expired_at, Time |
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
local env = os.getenv('DNMENV') or 'dev' | |
local configs = { | |
dev = { | |
db = { | |
address = "127.0.0.1", | |
port = 6379, | |
db = 0, | |
testdb = 15, | |
timeout = 1000, | |
keepalive = { 2000, 1 } |
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
> -- collected from #lua user q66 | |
> foo = newproxy(true) | |
> getmetatable(foo).__gc = function() print("o hai!") end | |
> foo = nil | |
> collectgarbage() | |
o hai! | |
> foo = {} | |
> foo.__my_gc_thingy = newproxy(true) | |
> getmetatable(foo.__my_gc_thingy).__gc = function() print("collectin' a table") end | |
> foo = nil |
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) 2014, M Robert Martin <rob@version2beta.com> | |
# This file is contributed to erlang.mk and subject to the terms of the ISC License. | |
.PHONY: shell | |
# Configuration. | |
SHELL_PATH ?= -pa ../$(PROJECT)/ebin $(DEPS_DIR)/*/ebin | |
SHELL_OPTS ?= |
OlderNewer