Skip to content

Instantly share code, notes, and snippets.

@radix
radix / specific-loadbalancer-nodes.xml
Last active October 7, 2015 17:26
/{tenant_id}/loadbalancers/{lb_id}/nodes.atom
<?xml version='1.0' encoding='UTF-8'?><feed xmlns="http://www.w3.org/2005/Atom"><link rel="next" href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411/nodes.atom?page=2" /><title type="text">Nodes Feed</title><id>756004-loadbalancers-493411-nodes</id><author><name>Rackspace Cloud</name></author><entry><title type="text">Node Successfully Updated</title><summary type="text">Node successfully updated with address: '10.181.30.33', port: '80', weight: '1', condition: 'DRAINING'</summary><author><name>radix192;q=1.0</name></author><link href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411/nodes/1007563" /><id>756004-loadbalancers-493411-nodes-1007563-2015280343480</id><category term="UPDATE" /><updated>2015-10-07T03:43:48.000Z</updated></entry><entry><title type="text">Node Successfully Created</title><summary type="text">Node successfully created with address: '10.181.30.33', port: '82', condition: 'ENABLED', weight: '1'</summary><author><name>r
@radix
radix / specific-loadbalancer.xml
Last active October 7, 2015 17:28
/{tenant_id}/loadbalancers/{lb_id}.atom
<?xml version='1.0' encoding='UTF-8'?><feed xmlns="http://www.w3.org/2005/Atom"><link rel="next" href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411.atom?page=2" /><title type="text">Load Balancer Feed</title><id>756004-loadbalancers-493411</id><author><name>Rackspace Cloud</name></author><entry><title type="text">Load Balancer Successfully Created</title><summary type="text">Load balancer successfully created with name: 'lb1', algorithm: 'LEAST_CONNECTIONS', protocol: 'HTTP', port: '80'</summary><author><name>radix192;q=1.0</name></author><link href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411" /><id>756004-loadbalancers-493411-20152781613440</id><category term="CREATE" /><updated>2015-10-05T16:13:44.000Z</updated></entry><entry><title type="text">Connection Logging Successfully Updated</title><summary type="text">Connection logging successully set to false</summary><author><name>radix192;q=1.0</name></author><link href="https://dfw.lo
@radix
radix / loadbalancers.xml
Last active October 7, 2015 17:28
/{tenant_id}/loadbalancers.atom
<?xml version='1.0' encoding='UTF-8'?><feed xmlns="http://www.w3.org/2005/Atom"><link rel="next" href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers.atom?page=2" /><title type="text">Parent Feed</title><id>756004-loadbalancers</id><author><name>Rackspace Cloud</name></author><entry><title type="text">Node Successfully Updated</title><summary type="text">Node successfully updated with address: '10.181.30.33', port: '80', weight: '1', condition: 'DRAINING'</summary><author><name>radix192;q=1.0</name></author><link href="https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/756004/loadbalancers/493411/nodes/1007563" /><id>756004-loadbalancers-493411-nodes-1007563-2015280343480</id><category term="UPDATE" /><updated>2015-10-07T03:43:48.000Z</updated></entry><entry><title type="text"></title><summary type="text">&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?>
&lt;entry xmlns:ns2="http://docs.rackspace.com/core/event" xmlns="http://www.w3.org/2005/Atom" xmlns:ns3="http://docs
@radix
radix / gist:3ce686b15528668377de
Created October 6, 2015 23:44
cryptography failing to build
Installed /tmp/pip_build_jenkins/cryptography/pycparser-2.14-py2.7.egg
running bdist_wheel
running build
running build_py
creating build
@radix
radix / testing-free-monads.hs
Last active May 14, 2019 12:47
Final haskell example for my STL talk
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ViewPatterns #-}
import Text.Show.Functions
import Control.Monad.Operational
-- Core effect definition
data Intent result where
@radix
radix / operational-first-instruction.hs
Created September 22, 2015 14:48
trying to extract the first instruction in an Operational program
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
import Control.Monad.Operational
data Intent result where
Prompt :: String -> Intent String
Display :: String -> Intent ()
deriving instance Show (Intent result)
type MyEffect a = Program Intent a
@radix
radix / testing-free-monads.hs
Created September 20, 2015 21:07
Testing effectful programs in Haskell, take 2
-- With much thanks to Cirdec of Stack Overflow: http://stackoverflow.com/questions/32673144/how-do-i-compare-a-program-specified-as-a-free-monad-against-a-description-of-ex
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ViewPatterns #-}
import Text.Show.Functions
import Control.Monad.Operational
-- Core effect definition
@radix
radix / freemonaddsl.hs
Created September 19, 2015 17:27
free monad DSL without a terminal case
{-# LANGUAGE DeriveFunctor, FlexibleInstances, ExistentialQuantification, RankNTypes #-}
import Control.Monad.Free
class Monad m => MyEffects m where
prompt :: String -> m String
display :: String -> m ()
-- end :: m ()
data DSL next
class MethodNameDispatcherThing(object):
def __init__(self, target, types_to_method_names):
self.target = target
self.types_to_method_names = types_to_method_names
def __call__(self, intent):
method_name = self.types_to_method_names.get(type(intent), None)
if method_name is not None:
return getattr(self.target, method_name)
## Model
from pyrsistent import PClass, field, pmap_field, pvector_field
class Thing(PClass):
name = field(basestring)
class Location(PClass):
name = field(basestring)
description = field(basestring)