An attempt at contrasting Nix and Python syntax (maybe helpful to grasp Nix faster for those with a Python background) based on the "Nix tour" found here: https://nixcloud.io/tour/?id=1
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 Name | Total Downloads | | |
+-----+-----------------+-----------------+ | |
| 1 | setuptools | 52,454,151 | | |
| 2 | requests | 42,297,369 | | |
| 3 | virtualenv | 38,499,034 | | |
| 4 | distribute | 36,848,278 | | |
| 5 | six | 34,594,923 | | |
| 6 | boto | 33,578,502 | | |
| 7 | pip | 29,951,145 | |
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 | |
# _*_ coding: UTF-8 _*_ | |
"""Print certain stats for subject line length in mailbox files. | |
The idea is to find out the percentage of lines up to the length | |
of twice the mailing list tag inside square brackets. | |
""" | |
import re |
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 | |
# -*- coding: utf-8 -*- | |
"""A script for comparing TrueType font rendering on different platforms. | |
""" | |
import os | |
import sys | |
import platform | |
import argparse |
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
""" | |
An experimental extension for an IPython magic command to show object graphs. | |
Strongly based on tkf's code for the extension itself | |
and mine for turning a Python namespace into a GraphViz DOT source: | |
- https://github.com/tkf/ipython-hierarchymagic | |
- http://pypi.python.org/pypi/pyrels/0.1.1 | |
Read respective copyrights there! |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from __future__ import print_function | |
""" | |
Create a structured, but more compact JSON representation of a native data structure. | |
This is inspired by the way native Python data structures are displayed in Jupyter, | |
e.g.: | |
In [1]: d = {"count": 7, "limit": 7, "results": [{"path": "wifi", "meaning": "rssi", "points": [{"timestamp": 1458211728242, "value": -67}, {"timestamp": 1458211736170, "value": -74}, {"timestamp": 1458211740399, "value": -62}, {"timestamp": 1458211746265, "value": -64}], "deviceId": "1e31f865-93b9-482a-a7be-858b56c396ae"}, {"path": "/", "meaning": "batteryLevel", "points": [{"timestamp": 1458211728413, "value": 90}, {"timestamp": 1458211736216, "value": 90}, {"timestamp": 1458211740443, "value": 90}], "deviceId": "1e31f865-93b9-482a-a7be-858b56c396ae"}], "offset": 0} |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
A tool for signaling processes found also by their command-line invocation. | |
Sometimes you want to terminate a process based on some specific substring | |
in the command that was entered in a terminal to start it, e.g. here you | |
might want to terminate only a process like this that is running a Python | |
SimpleHTTPServer started with:: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer