Skip to content

Instantly share code, notes, and snippets.

Cindy Brown ceeblet

Block or report user

Report or block ceeblet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ceeblet
ceeblet / openSSL_solution.txt
Created Apr 9, 2018
errors installing cryptography_one solution
View openSSL_solution.txt
brew install openssl
then brew gives a hint:
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
@ceeblet
ceeblet / python_list_syntax
Created Apr 5, 2018
Python's list slice syntax: a few fun and useful things
View python_list_syntax
# Python's list slice syntax can be used without indices
# for a few fun and useful things:
# You can clear all elements from a list:
>>> lst = [1, 2, 3, 4, 5]
>>> del lst[:]
>>> lst
[]
# You can replace all elements of a list
@ceeblet
ceeblet / dict_case_switch.py
Created Mar 20, 2018
dicts as case or switch
View dict_case_switch.py
def dispatch_if(operator, x, y):
if operator == 'add':
return x + y
elif operator == 'sub':
return x - y
elif operator == 'mul':
return x * y
elif operator == 'div':
return x / y
else:
View gist:9187f4b0ac7fe82a3e46da4a331ce15c
import argparse
fqdn = "domain.com"
def mongo_by_url(uri):
uri_pieces = uri.split(":")
data = {
"user": uri_pieces[1].replace("//", ""),
View keybase.md

Keybase proof

I hereby claim:

  • I am ceeblet on github.
  • I am ceeblet (https://keybase.io/ceeblet) on keybase.
  • I have a public key whose fingerprint is 3464 DE5B 6D62 C8FB 20AD 6BD1 8256 1EC7 EA81 3A0E

To claim this, I am signing this object:

@ceeblet
ceeblet / index.html
Created May 5, 2015
Drawing SVG Shapes with D3 Drawin Shapes w/ D3 = // source http://jsbin.com/yeremu
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Drawin Shapes w/ D3 = " />
<meta charset="utf-8">
<title>Drawing SVG Shapes with D3</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<svg width="250" height="50">
@ceeblet
ceeblet / index.html
Created May 4, 2015
Drawing SVG Shapes with D3 Drawin Shapes w/ D3 = // source http://jsbin.com/raboraputi
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Drawin Shapes w/ D3 = " />
<meta charset="utf-8">
<title>Drawing SVG Shapes with D3</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<h3>SVG Bar</h3>
@ceeblet
ceeblet / function_composition.py
Created Mar 10, 2015
console session demonstrating function composition
View function_composition.py
>>> def compose(g, h):
... def anon(x):
... return g(h(x))
... return anon
...
>>> f3 = compose(f1, f2)
>>> f3("Shillalegh")
<__main__.Func object at 0x100569dd0>('Shillalegh') called
f1('Shillalegh') called
'Shillalegh'
@ceeblet
ceeblet / find_attrs.py
Created Mar 10, 2015
console session - finding attributes that belong to function only, not inherited by object.
View find_attrs.py
def g(x):
return x*x
g
<function g at 0x000000000306A268>
type(g)
<class 'function'>
dir(g)
['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
def f(x):
@ceeblet
ceeblet / working profile
Created Mar 7, 2015
my current working .profile on MacOS
View working profile
########### alias' ###################
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# -> Prevents accidentally clobbering files.
alias mkdir='mkdir -p'
alias h='history'
alias j='jobs -l'
alias which='type -a'
You can’t perform that action at this time.