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| #!/bin/bash | |
| # No username or passwords in this script, you should use mysql_config_editor | |
| # to store it securely. The login-path in this script is set to "local-backup" so when you create | |
| # your .mylogin.cnf with the mysql-config-editor make sure it is set the same | |
| # See http://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html | |
| # An example to create your config for a mysql user "backup": | |
| # shell> sudo mysql_config_editor set --login-path=local-backup --host=localhost --user=backup --password | |
| # The backup user in the mysql server needs these privileges: SELECT, RELOAD, SHOW DATABASES, REPLICATION CLIENT |
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| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| import simplejson | |
| import sqlalchemy | |
| from sqlalchemy import String | |
| from sqlalchemy.ext.mutable import Mutable | |
| class JSONEncodedObj(sqlalchemy.types.TypeDecorator): | |
| """Represents an immutable structure as a json-encoded string.""" | |
| impl = String |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |