Skip to content

Instantly share code, notes, and snippets.

@obelisk68
Created May 9, 2016 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obelisk68/3b59683c1054d2993b7abc1e63873942 to your computer and use it in GitHub Desktop.
Save obelisk68/3b59683c1054d2993b7abc1e63873942 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1mHelp\u001b[0m\n",
" help Show a list of commands or information about a specific command.\n",
"\n",
"\u001b[1mContext\u001b[0m\n",
" cd Move into a new context (object or scope).\n",
" find-method Recursively search for a method within a class/module or the current namespace.\n",
" ls Show the list of vars and methods in the current scope.\n",
" pry-backtrace Show the backtrace for the pry session.\n",
" raise-up Raise an exception out of the current pry instance.\n",
" reset Reset the repl to a clean state.\n",
" watch Watch the value of an expression and print a notification whenever it changes.\n",
" whereami Show code surrounding the current context.\n",
" wtf? Show the backtrace of the most recent exception.\n",
"\n",
"\u001b[1mEditing\u001b[0m\n",
" /^\\s*!\\s*$/ Clear the input buffer.\n",
" amend-line Amend a line of input in multi-line mode.\n",
" edit Invoke the default editor on a file.\n",
" hist Show and replay readline history.\n",
" play Playback a string variable, method, line, or file as input.\n",
" show-input Show the contents of the input buffer for the current multi-line expression.\n",
"\n",
"\u001b[1mIntrospection\u001b[0m\n",
" ri View ri documentation.\n",
" show-doc Show the documentation for a method or class.\n",
" show-source Show the source for a method or class.\n",
" stat View method information and set _file_ and _dir_ locals.\n",
"\n",
"\u001b[1mGems\u001b[0m\n",
" gem-cd Change working directory to specified gem's directory.\n",
" gem-install Install a gem and refresh the gem cache.\n",
" gem-list List and search installed gems.\n",
" gem-open Opens the working directory of the gem in your editor.\n",
"\n",
"\u001b[1mCommands\u001b[0m\n",
" import-set Import a pry command set.\n",
" install-command Install a disabled command.\n",
"\n",
"\u001b[1mAliases\u001b[0m\n",
" !!! Alias for `exit-program`\n",
" !!@ Alias for `exit-all`\n",
" $ Alias for `show-source`\n",
" ? Alias for `show-doc`\n",
" @ Alias for `whereami`\n",
" clipit Alias for `gist --clip`\n",
" file-mode Alias for `shell-mode`\n",
" history Alias for `hist`\n",
" quit Alias for `exit`\n",
" quit-program Alias for `exit-program`\n",
" reload-method Alias for `reload-code`\n",
" show-method Alias for `show-source`\n",
"\n",
"\u001b[1mInput and output\u001b[0m\n",
" .<shell command> All text following a '.' is forwarded to the shell.\n",
" cat Show code from a file, pry's input buffer, or the last exception.\n",
" change-inspector Change the current inspector proc.\n",
" change-prompt Change the current prompt.\n",
" fix-indent Correct the indentation for contents of the input buffer\n",
" list-inspectors List the inspector procs available for use.\n",
" list-prompts List the prompts available for use.\n",
" save-file Export to a file using content from the repl.\n",
" shell-mode Toggle shell mode. bring in pwd prompt and file completion.\n",
"\n",
"\u001b[1mMisc\u001b[0m\n",
" gist Upload code, docs, history to https://gist.github.com/.\n",
" pry-version Show pry version.\n",
" reload-code Reload the source file that contains the specified code object.\n",
" toggle-color Toggle syntax highlighting.\n",
"\n",
"\u001b[1mNavigating pry\u001b[0m\n",
" !pry Start a pry session on current self.\n",
" disable-pry Stops all future calls to pry and exits the current session.\n",
" exit Pop the previous binding.\n",
" exit-all End the current pry session.\n",
" exit-program End the current program.\n",
" jump-to Jump to a binding further up the stack.\n",
" nesting Show nesting information.\n",
" switch-to Start a new subsession on a binding in the current stack.\n",
"\n",
"\u001b[1mPrompts\u001b[0m\n",
" simple-prompt Toggle the simple prompt."
]
}
],
"source": [
"help"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"[Markdown](https://ja.wikipedia.org/wiki/Markdown)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3 [1, 3]\n",
"6 [1, 2, 3, 6]\n",
"9 [1, 3, 9]\n",
"12 [1, 2, 3, 4, 6, 12]\n",
"15 [1, 3, 5, 15]\n",
"18 [1, 2, 3, 6, 9, 18]\n",
"21 [1, 3, 7, 21]\n"
]
}
],
"source": [
"require 'bundler/setup'\n",
"require 'utils'\n",
"require 'utilsc'\n",
"\n",
"loop_with_index(3, 3) do |n|\n",
" puts \"#{n} #{n.divisors.sort}\"\n",
" break if n > 20\n",
"end"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Ruby 2.2.3",
"language": "ruby",
"name": "ruby"
},
"language_info": {
"file_extension": ".rb",
"mimetype": "application/x-ruby",
"name": "ruby",
"version": "2.2.3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment