c3.large c4.large c4 / c3
===========================================================================================
Dhrystone 2 using register variables 34752053.9 lps 43996767.0 lps 1.2660
Double-Precision Whetstone 4459.8 MWIPS 8113.5 MWIPS 1.8193
Execl Throughput 4110.8 lps 7697.1 lps 1.8724
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
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
def human_log(res): | |
if isinstance(res, dict): | |
for field in FIELDS: | |
if field in res.keys(): | |
encoded_field = res[field].encode('utf-8') | |
print '\n{0}:\n{1}'.format(field, encoded_field) |
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
git ls-tree -r --name-only HEAD | while read filename; do | |
echo "$(git log -1 --format="%ad" --date=iso -- $filename) $filename" | |
done | sort |
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
infix operator ➡️: AdditionPrecedence | |
enum 🖇<🤖>: Collection, CustomStringConvertible { | |
indirect case 📎(🤖, 🖇) | |
case 🚫 | |
func makeIterator() -> AnyIterator<🤖> { | |
var 📌 = self | |
return AnyIterator { |
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
Moved to https://github.com/dbrgn/drf-dynamic-fields |
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
#!/usr/bin/env python3 | |
""" | |
We want to buy magnetic letters to teach French at home during the COVID-19 crisis. | |
I was wondering what is the optimal bag of letters to be able to *write* French words. | |
This script implements two ways of estimating this, *optimal bag of letters*: | |
- Per word max occurrence of each letters (ensure the bare minimum to write any single word of the dictionary [1]) | |
- Statistical occurrence of letters (biased as words frequency is strongly dependent of the context [2]) |
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
jQuery.expr[':'].regex = function(elem, index, match) { | |
var matchParams = match[3].split(','), | |
validLabels = /^(data|css):/, | |
attr = { | |
method: matchParams[0].match(validLabels) ? | |
matchParams[0].split(':')[0] : 'attr', | |
property: matchParams.shift().replace(validLabels,'') | |
}, | |
regexFlags = 'ig', | |
regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags); |
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 FullPaths(argparse.Action): | |
"""Expand user- and relative-paths""" | |
def __call__(self, parser, namespace, values, option_string=None): | |
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
def is_dir(dirname): | |
"""Checks if a path is an actual directory""" | |
if not os.path.isdir(dirname): | |
msg = "{0} is not a directory".format(dirname) | |
raise argparse.ArgumentTypeError(msg) |
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
#!/usr/bin/env python | |
""" | |
Convert camel-case to snake-case in python. | |
e.g.: CamelCase -> snake_case | |
e.g.: snake_case -> CamelCase | |
e.g.: CamelCase -> dash-case | |
e.g.: dash-case -> CamelCase | |
By: Jay Taylor [@jtaylor] | |
Me<modifier>: Yahya Kacem <fuj.tyoli@gmail.com> | |
Original gist: https://gist.github.com/jaytaylor/3660565 |
This works in a python 3.6 environment with bokeh and flask installed. To use this you need the following directory structure:
app/
- templates/
- hello.html
- bokeh-slider.py
- hello.py
After that you need to open two terminals at app/, in the first one you need to run the bokeh server with the command:
OlderNewer