This is just some stencils I created for myself to draw FMC (http://www.fmc-modeling.org/) diagrams with draw.io.
Here is how they look:
# taken from user Albert's answer on StackOverflow | |
# http://stackoverflow.com/questions/5292204/macosx-get-foremost-window-title | |
# tested on Mac OS X 10.7.5 | |
global frontApp, frontAppName, windowTitle | |
set windowTitle to "" | |
tell application "System Events" | |
set frontApp to first application process whose frontmost is true | |
set frontAppName to name of frontApp |
man -t bash | open -f -a Preview |
import sys | |
d = {} | |
for line in sys.stdin: | |
adds, dels, path = line.rstrip().split('\t') | |
if path in d: | |
d[path]['adds'] += int(adds) | |
d[path]['dels'] += int(dels) | |
d[path]['count'] += 1 |
\newcommand{\cvitemleft}[3][.25em]{% | |
\begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}% | |
\hintstyle{#2} &{#3}% | |
\end{tabular}% | |
\par\addvspace{#1} | |
} | |
\newcommand{\cventryleft}[7][.25em]{% | |
\cvitemleft[#1]{#2}{% | |
{\bfseries#3}% |
# USAGE: | |
# {% load file_the_templatetag_is_in %} | |
# {{ my_hex_color| hex_to_rgb }} | |
# {{ my_hex_color| hex_to_rgb:'rgba({r},{g},{b}, 0.5)' }} | |
# {{ my_hex_color| hex_to_rgb:'Components: r:{r},g:{g},b:{b}' }} | |
# adapted from https://github.com/guillaumeesquevin/django-colors | |
@register.filter(name='hex_to_rgb') | |
def hex_to_rgb(hex, format_string='rgb({r},{g},{b})'): | |
"""Returns the RGB value of a hexadecimal color""" |
This is just some stencils I created for myself to draw FMC (http://www.fmc-modeling.org/) diagrams with draw.io.
Here is how they look:
#! /usr/bin/env python3 | |
# coding=utf-8 | |
# Python version of | |
# http://www.tomdalling.com/blog/software-design/fizzbuzz-in-too-much-detail/ | |
# Run it live at: | |
# https://www.pythonanywhere.com/gists/02d713164ca0f6882f50/fizzbuzz.py/ipython3/ | |
### A Naïve Implementation |
wget -qO- --header="Accept: application/x-bibtex" "https://doi.org/10.1109/5.771073" |
#!/usr/bin/env python3 | |
# In this bonus challenge, you'll need to check the winner of the battle but this time, a sorcerer wins if he succeeds in winning 3 spell clashes in a row. | |
# | |
# 1. Create variables POWER, gandalf and saruman as seen above. | |
# | |
# spells have names, dictionary that associates that name to a power. | |
POWER = { | |
'Fireball': 50, |
http://neo4j.com/docs/2.1/cypher-refcard/
labels(n)
MATCH n
RETURN distinct labels(n), count(n) as count_n