http://neo4j.com/docs/2.1/cypher-refcard/
labels(n)
MATCH n
RETURN distinct labels(n), count(n) as count_n
| category:primary is:unread |
http://neo4j.com/docs/2.1/cypher-refcard/
labels(n)
MATCH n
RETURN distinct labels(n), count(n) as count_n
| # Workaround for "There are too many directories in your application for changes in all of them to be monitored." | |
| # message in Flask | |
| echo fs.inotify.max_user_watches=100000 | sudo tee -a /etc/sysctl.conf; sudo sysctl -p |
| # Run it live at | |
| # https://www.pythonanywhere.com/gists/9671392e68fc0fff324c/all_functions.py/ipython3/ | |
| import inspect, sys | |
| def func1(): | |
| pass | |
| def func2(): | |
| pass |
| #! /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 |
| #! /usr/bin/env python3 | |
| # coding=utf-8 | |
| # Check if a number is happy or sad | |
| # http://en.wikipedia.org/wiki/Happy_number | |
| def happy(number, past = None): | |
| def happy_calc(number): | |
| return sum((int(digit)**2 for digit in str(number))) |
| # 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""" |
| function $(q, parent) { | |
| parent = parent || document; | |
| //convert DOM NodeList into array, so that e.g. 'forEach' can be called. | |
| return Array.prototype.slice.call(parent.querySelectorAll(q)); | |
| } |
| /* | |
| * Using callbacks to set scope variables (Not as nice) | |
| */ | |
| var app = angular.module("MyApp", []); | |
| app.factory('sourceService', function($http, $q, $log) { | |
| return { | |
| get : function(){ | |
| var endpoint = 'data.json'; |