Skip to content

Instantly share code, notes, and snippets.

View nuxlli's full-sized avatar
🎯
Focusing

Everton Ribeiro nuxlli

🎯
Focusing
View GitHub Profile
@nuxlli
nuxlli / Azkfile.js
Last active August 29, 2015 13:58
Azufile full example
/**
* http://azk.io file
*/
'use strict';
module.exports = function(azk) {
// Global image to reuse
var base = { repository: "azukiapp/rails" });
...
findImage(name) {
return this.getImage(name).inspect()
.then(
(_data) => { return this.getImage(name); },
(err ) => {
if (err.statusCode == 404)
return null;
throw err;
}
@nuxlli
nuxlli / valgrind.log
Created August 14, 2014 18:58
Log of the valgrind for nss_resolver
[==========] Running 3 test(s).
[ RUN ] gethostbyname_unknown_name_test
[ OK ] gethostbyname_unknown_name_test
[ RUN ] resolver_by_nameserver_test
==14327== Conditional jump or move depends on uninitialised value(s)
==14327== at 0x404B4C: ares_init_options (in /azk/resolver-nss/build/test)
==14327== by 0x4019DD: resolver_by_servers (resolver.c:97)
==14327== by 0x40276B: resolver_by_nameserver_test (test.c:88)
==14327== by 0x503F16B: _run_test (in /usr/local/lib/libcmocka.so.0.2.1)
==14327== by 0x503FA0F: _run_group_tests (in /usr/local/lib/libcmocka.so.0.2.1)
@nuxlli
nuxlli / Azkfile.js
Last active August 29, 2015 14:06
azk mongo and postresql example
systems({
mongodb: {
scalable: false,
ports: {
http: "28017",
}
http : {
hostname: "#{manifest.dir}-#{system.name}.#{azk.default_domain}",
},
persistent_folders : [ "/data/db" ],
@nuxlli
nuxlli / Azkfile.js
Last active August 29, 2015 14:06
New volumes options in Azkfile.js
systems({
app: {
// ...
mounts: {
// equivalent mount_folders
'/azk/root' : '/',
'/azk/app' : path('.'),
'/azk/demos' : path('../demos', { required: false }),
'/azk/Gemfile': path('./Gemfile', { mode: 'r' }), // File example
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
var ruby_system = function(command) {
return {
// Dependent systems
depends: ["postgres", "mongodb", "redis", "mail"],
// More images: http://images.azk.io
image: "gullitmiranda/ruby",
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
function ruby_system(command, extra) {
var merge = require('azk')._.merge;
var extra = extra || {};
return merge({
// Dependent systems
@nuxlli
nuxlli / generator_arq.js
Created October 29, 2014 16:33
Arquitetura de julgamento do generator do azk
// rails 4, node.js, mysql
/*
Rules = investigator + jury
Generator.detect [
[Rules].investigate();
Generator.judgment();
[Rules].verdict();
]
@nuxlli
nuxlli / error.sh
Created November 4, 2014 19:22
refactoring source path error
azk: Error: one test error
azk: at Cmd.<anonymous> (/AZK_v0.6.1-dev/src/cmds/info.js:13:13)
azk: at eval (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:589:32)
azk: at nextOrThrow (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:496:21)
azk: at GeneratorFunctionPrototype.next (eval at <anonymous> (/Users/nuxlli/Work/azuki/azk/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:516:14)
azk: at /AZK_v0.6.1-dev/src/utils/index.js:86:26
azk: at /AZK_v0.6.1-dev/src/utils/index.js:63:24
azk: From previous event:
azk: at /AZK_v0.6.1-dev/src/utils/index.js:69:16
azk: at node.js:906:3
@nuxlli
nuxlli / ccat.sh
Created December 19, 2014 17:37
Same of cat, but with colors \o/
#!/bin/bash
# Font: http://scott.sherrillmix.com/blog/programmer/syntax-highlighting-in-terminal/
if [ ! -t 0 ];then
file=/dev/stdin
elif [ -f $1 ];then
file=$1
else
echo "Usage: $0 code.c"