This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"reflect" | |
"strconv" | |
"strings" | |
clowder "github.com/redhatinsights/app-common-go/pkg/api/v1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install HA Proxy package | |
#> yum install haproxy | |
2. Generate the self-signed cert | |
#> mkdir -p /etc/pki/haproxy | |
#> umask 077 && openssl genrsa -out /etc/pki/haproxy/haproxy.key 1024 | |
#> umask 022 && openssl req -key /etc/pki/haproxy/haproxy.key \ | |
-out /etc/pki/haproxy/haproxy.crt \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/") t) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(package-initialize) | |
;(package-refresh-contents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\score { | |
\new DrumStaff | |
<< | |
\set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) | |
\context DrumVoice = "1" { s1 } | |
\context DrumVoice = "2" { s2 } | |
\drummode { | |
<< | |
{ | |
toml8 <toml sn>8 toml16 sn16 toml8 <toml sn>8 toml16 sn16~ sn16 toml16 sn8| % use bar checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#(define mydrums '( | |
(bassdrum default #f -3) | |
(snare default #f 1) | |
(hihat cross #f 5) | |
(halfopenhihat cross "halfopen" 5) | |
(pedalhihat xcircle "stopped" 2) | |
(lowtom diamond #f 3) | |
(crashcymbal cross #f 6))) | |
up = \drummode { hh8 hh hhho hhho hhp4 hhp } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Appliance(object): | |
def __init__(self, var): | |
print "inited" | |
self.var = var | |
def __enter__(self): | |
print "entering" | |
print "the var is {}".format(self.var) | |
return self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
if __name__ == "__main__": | |
data = sys.stdin.read() | |
ips = set([b[0] for b in re.findall('((\d{1,3}\.){3}\d{1,3})', data)]) | |
for ip in sorted(ips): | |
print ip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def defer(func, *args): | |
... return partial(partial, func)(*args) | |
... | |
>>> defer(max, [1,2,3]) | |
<functools.partial object at 0xe411b0> | |
>>> p = defer(max, [1,2,3]) | |
>>> p() | |
3 | |
>>> | |
>>> b = partial(max, [1,2,3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.fixture(params=['a', 'b']) | |
def do_something(request): | |
print request.param | |
@pytest.usefixtures(do_something, params=['c']) | |
def do_something_with_something_else(): | |
'''Like to pass a custom setof params to the fixture''' |