Skip to content

Instantly share code, notes, and snippets.

{hello}
in controller
def show
@contract = Contract.find(1) # you'll normally take a number from params instead
@orders = @contract.orders
end
in your view aka show.html.erb
curl -s https://api.github.com/orgs/iron-io/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
public function publishAction()
{
$message = ['foo' => 'bar'];
// fetch your provider service from the container
$this->get('uecode_qpush')->get('my_queue_name')->publish($message);
}
@Stephenitis
Stephenitis / ExampleService.php
Last active August 29, 2015 14:02
src/My/Bundle/ExampleBundle/Service/ExampleService.php
use Uecode\Bundle\QPushBundle\Event\MessageEvent;
use Uecode\Bundle\QPushBundle\Message\Message;
public function onMessageReceived(MessageEvent $event)
{
$id = $event->getMessage()->getId();
$body = $event->getMessage()->getBody();
$metadata = $event->getMessage()->getMetadata();
// do some processing
Successfully installed netrc-0.7.7
Successfully installed rest_client-1.7.3
Successfully installed net-http-persistent-2.9.4
Successfully installed rest-2.7.1
Successfully installed iron_core-1.0.4
Successfully installed bundler-1.6.3
Successfully installed rubyzip-0.9.9
Successfully installed iron_worker_ng-1.5.0
8 gems installed
I, [2014-07-11T23:07:45.259352 #17] INFO -- IronWorkerNG: Found workerfile with path='worker200.worker'
Grid Analysis and Display System (GrADS) Version 2.0.2
Copyright (c) 1988-2011 by Brian Doty and the
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information
Config: v2.0.2 little-endian readline printim grib2 netcdf hdf4-sds hdf5 opendap-grids,stn geotiff shapefile
Issue 'q config' command for more detailed configuration information
GX Package Initialization: Size = 11 8.5
Running in Batch mode
@Stephenitis
Stephenitis / gist:67d149ba643249d91800
Created August 7, 2014 09:05
log node version and openssl version within nodescript
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) } exec("openssl version", puts);
console.log(process.version);
# declare stack
stack "ffmpeg-2.3"
# this is the important part that will include ffmpeg-2.3 gpac 0.51
# OS - Ubuntu 12.04.5
# check out all the installed libraries on this stack here
# declare runtime to use
runtime "ruby"
# declare a runtime our FFMPEG stack supports
# -Python
runtime 'node'
stack 'node-0.10'
exec 'main_worker.js'
dir '../models'
dir '../config'
dir '../node_modules'
dir '../lib'
dir '../jobs'
dir '../main_worker'
name 'MainWorker'