Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Example of `builder' design pattern | |
| # Copyright (C) 2011 Radek Pazdera | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. |
| """ | |
| Functions for converting dates to/from JD and MJD. Assumes dates are historical | |
| dates, including the transition from the Julian calendar to the Gregorian | |
| calendar in 1582. No support for proleptic Gregorian/Julian calendars. | |
| :Author: Matt Davis | |
| :Website: http://github.com/jiffyclub | |
| """ |
| import os.path | |
| import collections | |
| from operator import itemgetter | |
| WORDFILE = '/usr/share/dict/words' | |
| class Autocorrect(object): | |
| """ | |
| Very simplistic implementation of autocorrect using ngrams. | |
| """ |
| public static IEnumerable<TResult> Map<in TSource, TResult>(IEnumerable<TSource> sources, Func<TSource, TResult> mapper) | |
| { | |
| foreach (var source in sources) | |
| { | |
| yield return mapper(source); | |
| } | |
| } |
| #!perl -w | |
| =head1 NAME | |
| pl2py.pl | |
| =head1 DESCRIPTION | |
| Attempts to convert perl scripts to python with the awesome power of regular expressions. |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| """Adapted from http://askubuntu.com/a/141641 | |
| This compatibility layer allows to use either PySide or PyQt4 as the Qt | |
| binding. It will choose what's available, defaulting on PySide, unless the | |
| QT_API environment variable is set. | |
| """ | |
| import os | |
| import sys |
| # Gitlab install instructions: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md | |
| # Cross-compiling on Rpi: https://raspberrypi.stackexchange.com/questions/1/how-do-i-build-a-gcc-4-7-toolchain-for-cross-compiling | |
| apt-get update -y | |
| apt-get upgrade -y | |
| apt-get install -y sudo | |
| apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate | |
| apt-get install -y git-core |
| #!/usr/bin/env python | |
| """Basic Python Cheat Sheet by Filip Kral on 2015/02/16""" | |
| """ | |
| Python is a cross-platform, interpreted, object-oriented programming language. | |
| That means you can run it on Linux, Windows, Mac, and other platforms, | |
| you don't need to compile your code to execute it because it is compiled on | |
| the fly, and you can use classes and objects. |