Skip to content

Instantly share code, notes, and snippets.

View phyxavier's full-sized avatar

Bernard Otu phyxavier

  • Invokevoke Inc
  • Canada
View GitHub Profile
@phyxavier
phyxavier / pyc
Created November 11, 2019 22:13 — forked from jkbrzt/pyc
Delete Python's compiled *.pyc files like a pro
#!/bin/sh
#
# Delete Python's compiled *.pyc and __pycache__ files like a pro
# https://gist.github.com/jakubroztocil/7892597
#
# Usage:
# Delele *.pyc and __pycache__ files recursively in the current directory:
# $ pyc
#
# The same, but under /path:
@phyxavier
phyxavier / dispatcher.rb
Created February 21, 2012 23:12
Proposed Messaging
require 'rubygems'
require 'ffi-rzmq'
context = ZMQ::Context.new
front_addr = "ipc:///tmp/dispatch-front.ipc"
back_addr = "ipc:///tmp/dispatch-back.ipc"
frontend = context.socket(ZMQ::XREP)
frontend.bind(front_addr)
def inventory_updated(splrid, updates)
self.update_attributes(updates)
#Error because WineScore.wine(self) is returning an array instead of object. Check mongo..there are multiple of objects for some these wine scores
WineScore.wine(self).supplier(splrid).each {|ws| ws.update_attributes({:inS => (self.total_stock > 0)}) }
end