Skip to content

Instantly share code, notes, and snippets.

View videlalvaro's full-sized avatar

Alvaro Videla videlalvaro

View GitHub Profile
@videlalvaro
videlalvaro / .emacs
Created July 4, 2012 08:39
my emacs file
(add-to-list 'load-path "~/Library/emacs")
;; js-mode
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;; less-mode
(require 'less-css-mode)
;;erlang-mode
@videlalvaro
videlalvaro / gist:2394475
Created April 15, 2012 19:42
make plugins errors
[ -d "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/../rabbitmq-server" ] || ln -s "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server" "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/../rabbitmq-server"
mkdir -p plugins
PLUGINS_SRC_DIR="" make -C "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/.." plugins-dist PLUGINS_DIST_DIR="/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/plugins" VERSION=2.8.1u
make -f all-packages.mk all-releasable VERSION=2.8.1u
rm -rf rabbitmq-server/dist
make -C ./rabbitmq-server
[ -d "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/../rabbitmq-server" ] || ln -s "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server" "/Users/mrhyde/Code/erlang/rabbitmq/rabbitmq-public-umbrella/rabbitmq-server/../rabbitmq-server"
mkdir -p plugins
PLUGINS_SRC_DIR="" make -C "/Users/mrhyde/Code/erlang/rabbitmq/rabb
#!/bin/sh
## The contents of this file are subject to the Mozilla Public License
## Version 1.1 (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License
## at http://www.mozilla.org/MPL/
##
## Software distributed under the License is distributed on an "AS IS"
## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
## the License for the specific language governing rights and
## limitations under the License.
conn_params = pika.ConnectionParameters("localhost",
virtual_host = "/",
credentials = creds_broker)
conn_params = pika.ConnectionParameters("localhost",
virtual_host = "/",
credentials = creds_broker)
services:
my_consumer:
class: Path\To\MyConsumer
arguments:
- @service_container
some empty file.
content_types_accepted(ReqData, State) ->
{[{"application/json", accept_content}], ReqData, State}.
accept_content(ReqData, Context) ->
%% process the JSON data
{true, ReqData, Context}.
post_is_create(ReqData, State) ->
{true, ReqData, State}.
File a.php
<?php
$data = glob(); //glob'ed stuff here whatever that is.
exec(sprintf('echo "<?php\n $cache = %s;" > ./some_file.php', var_export($data, true)));
?>
File b.php
<?php
// (a).
$args = new AMQPWriter();
if($ticket != NULL)
$args->write_short($ticket);
else
$args->write_short($this->default_ticket);
// vs.
// (b)
<?php
require_once('../lib/php-amqplib/amqp.inc');
define('HOST', 'localhost');
define('PORT', 5672);
define('USER', 'guest');
define('PASS', 'guest');
define('VHOST', '/');