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
// Dump this into your web console in a live notebook | |
function safeLog(type) { | |
try { | |
console.log.apply(console, arguments); | |
} catch(err) { | |
console.warn(type, 'could not print data'); | |
} | |
} | |
var orig1 = Jupyter.notebook.kernel.ws.onmessage; | |
Jupyter.notebook.kernel.ws.onmessage = function() { |
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
alias push="git push" | |
alias pull="git pull" | |
alias reb="git rebase" | |
alias com="git commit" | |
alias co="git checkout" | |
alias merge="git mergetool" | |
alias st="git status" | |
alias br="git branch" | |
alias add="git add" | |
alias grm="git rm" |
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 | |
""" | |
Interactive execution with automatic history, tries to mimic Mathematica's | |
prompt system. This environment's main features are: | |
- Numbered prompts (In/Out) similar to Mathematica. Only actions that produce | |
output (NOT assingments, for example) affect the counter and cache. | |
- The following GLOBAL variables always exist (so don't overwrite them!): | |
_p: stores previous result which generated printable output. |
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
// No need to sub class Array if what you need is just an extended | |
// array. Example below illustrates the way to extend Array. | |
function SubArray() { | |
return Object.defineProperties(Array.prototype.slice.call(arguments), SubArrayDescriptor) | |
} | |
SubArray.prototype = Array.prototype | |
var SubArrayDescriptor = | |
{ constructor: { value: SubArray } | |
, last: { value: function last() { |