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 -*- | |
| # | |
| # Copyright (c) 2013 by Xu Cheng ([email protected]) | |
| # | |
| import sys | |
| if sys.version[0] == '2': | |
| from io import open |
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| # This is a standard python config file | |
| # Valid values can be True, False, integer numbers, strings | |
| # By default bpython will look for ~/.config/bpython/config or you | |
| # can specify a file with the --config option on the command line | |
| # General section tag | |
| [general] | |
| # Display the autocomplete list as you type (default: True). | |
| # When this is off, you can hit tab to see the suggestions. |
| # This theme attempts to map Solarized Dark colors to bpython similar to | |
| # SublimeText 2. Requires Solarized Dark.ML.settings for Terminal.app. | |
| # Copy to ~/.bpython/solarized.theme and | |
| # set "color_scheme = solarized" in ~/bpython/config | |
| [syntax] | |
| keyword = g | |
| name = d | |
| comment = G |
The program below can take one or more plain text files as input. It works with python2 and python3.
Let's say we have two files that may contain email addresses:
foo bar
ok [email protected] sup
[email protected],wyd
hello world!
| #include <iostream> | |
| #include <hdf5.h> | |
| // Constants | |
| const char saveFilePath[] = "test.h5"; | |
| const hsize_t ndims = 2; | |
| const hsize_t ncols = 3; | |
| int main() |
| #!/usr/bin/env ruby | |
| # | |
| # Mac OS X webarchive is a binary format of a plist file. You can extract the contents manually: | |
| # 1. convert the plist file into XML by "plutil -convert xml1 file.webarchive" | |
| # 2. parse the resulted XML file by some XML parser | |
| # 3. decode "WebResourceData" by Base64.decode64(data) in each key | |
| # 4. save the decoded content into a file indicated by "WebResourceData" | |
| # Thankfully, the plist library can take care of annoying steps 2 and 3. | |
| # | |
| # Preparation: |
| #include <iostream> | |
| #include <vector> | |
| #include <time.h> | |
| #define _USE_MATH_DEFINES | |
| #include <math.h> | |
| #include "Frustum.h" | |
| #include <GL/freeglut.h> |
| from MySQLdb import connect | |
| conn = connect(user="[USER]", passwd= "[PASSWORD]") | |
| cur = conn.cursor() | |
| cur.execute("show databases;") | |
| dbs_to_update = filter( | |
| lambda db: db not in ('information_schema', 'mysql', 'performance_schema'), | |
| [dbname[0] for dbname in cur.fetchall()]) |
| ! ---=== Experiment with making Motif less ugly for DDD ===--- | |
| ! (DDD ignores generically-set Motif properties so we must do this) | |
| ! TODO (if possible): | |
| ! - Hide text cursors in unfocused fields | |
| ! - Convert on-hover effect from shadow to background color or border | |
| ! - Pick better fonts and check which package provides them | |
| ! Use the lighter background grey from the Lubuntu GTK+ theme | |
| ! (Still a cool grey. Eyedropper the Clearlooks warm grey if necessary.) | |
| Ddd*background: #e0e0e0 |